I have a layout for posts. The postscontroller redirects to this layout . I want my blog controller to use the same layout . I do not to put the layout as my application.html.erb since all other pages uses a different layout and I have put that as my applicationlayout.
Can i do something like this in my blog controller?
render :layout => “post”
If so which view page my yield command retrieve?
Yup,
render :layout => 'post'will do it. Theyieldin the layout will yield as you would expect ayieldin the application layout to.To set a controller-wide layout, use
layout 'layout_name'at the top of your controller.