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?
In your controller write
class TetsController < ApplicationController
layout "layout_name"
#...
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With