Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3853820
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:31:42+00:00 2026-05-19T17:31:42+00:00

the application.html.erb is a file that is applied to all views in rails. In

  • 0

the application.html.erb is a file that is applied to all views in rails. In a way, its the master file, that all child files are styled / structured after.

How can I use this with Sinatra?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:31:42+00:00Added an answer on May 19, 2026 at 5:31 pm

    What you want is called a “layout”; simply put a file named layout.haml (or layout.erb, or using the templating language of your choice) in your views directory and by default the contents of other views will be wrapped in it. Put the output of yield in the layout where the contents of individual views should go. For example:

    • Haml: = yield
    • Erb: <%= yield %>

    If you want the result of a route to use a different layout, you can specify the name of the alternative layout view like so:

    get "/login" do
       # ...
       haml :login, :layout => :logged_out
    
       # Or for ERb:
       # erb :login, :layout => :logged_out
    end
    

    If you want a particular route to not use any layout, pass false:

    get "/" do
       # ...
       haml :home, :layout => false
    
       # Or for ERb:
       # erb :home, :layout => false
    end
    

    For more, see the Sinatra book.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several partials that I'm including in my Rails application.html.erb file , but
I've installed devise on my app and applied the following in my application.html.erb file:
I have one HTML file located in app/views/layouts/application.html.erb I use <%=yield=> to render the
The application.html.erb file: <!DOCTYPE html> <html> <head> <title>Site</title> <%= stylesheet_link_tag :all %> <%= javascript_include_tag
File app/views/layouts/application.html.erb <!DOCTYPE html> <html> <head> <title><%= title %></title> <%= csrf_meta_tag %> <!--[if lt
I have this file: app/views/listings/list.html.erb in my rails project. Here are the contents of
My application.html.erb is a classic file with the <%= yield %> statement. The expected
In my Rails 3.2.3 application I have the following code in the application.html.erb to
Is there any way to suppress the default js and css loaded by application.html.erb
I don't know what's the best way to doing this. On my application.html.erb I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.