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

  • SEARCH
  • Home
  • 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 9179385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:46:58+00:00 2026-06-17T17:46:58+00:00

I am an entry developer in Rails and I am doing system study of

  • 0

I am an entry developer in Rails and I am doing system study of an Application developed in Ruby 1.8.7 and Rails 3.0.3. In my App, I have application_controller with an application.html.erb layout and a home_controller with a home_html.erb layout along with CRUD views. Then in my routes.rb, the default route is set as given below along with resourceful routing for home.

root :to => ‘home#index’

resources :home

In application.html.rb, we have default layout to be rendered inside which the other views need to be inserted using <%= yield %>. But I have another layout called home.html.erb whose contents are the same as that of the application.html.erb. When I run the app, the default layout is loaded from home.html.erb instead of application.html.erb. What could be the reason?

  • 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-06-17T17:46:59+00:00Added an answer on June 17, 2026 at 5:46 pm

    By Default, a controller will first look for a template with the
    same name inside the layouts folder and if not found, it will
    render the default application layout.

    In this scenario, when home_controller index action is performed, the layout rendered is home.html.rb along with the view content since home.html.rb is with the same naming format as of the controller. When I changed it to homes.html.rb, the controller takes application.html.rb from the layouts folder.
    So the solution is,

    Just remove home.html.erb from views/layouts/ folder. It will
    automatically render application.html.erb by default.

    Thanks everyone.

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

Sidebar

Related Questions

I have a program developed and it has a single entry point. A Try
I am referring to http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/AlarmService_Service.html There the runnable of the thread looks like this
I have an interview coming up for an entry level pl/sql developer job. I
I have installed the WebSphere Application Server Developer Tools for Eclipse V8.5.1 as well
What should someone know as an Entry Level, Mid-level, and Senior Developer working with
I have a project to develop for property dealer he has entry in db
I am entry level .Net developer and using it to develop web sites. I
I'm working through the 'notepad' tutorial given in the developer's guide: http://developer.android.com/guide/tutorials/notepad/index.html For some
I have some xml like <entry> <a>a</a> ... <subelement> <b>b</b> .... </subelement> </entry> if
I'm working at a company as a entry-level developer. I'm having a hard time

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.