|
Peter Marklund's Home |
Rails Tip: Nested Layouts
This is just a feature I always wanted in Rails - nested layouts, i.e. the ability to have one master layout (application.rhtml) for your whole site, and then to have layouts within that that differ from section to section. Today I stumbled across this hack - just a single helper method that allows the use of nested layouts. Sweet. I'll re-post the code here:
end
Comments
Jon said over 4 years ago:
Isn't this the same as render :layout => 'partial_with_yield' do .. end?
cs said over 4 years ago:
sorry, the link to the hack is broken ...
cs said over 4 years ago:
this seem sto be working now:
Peter Marklund said over 4 years ago:
Here is an alternative approach that seems to work and doesn't require any patches:
http://mattmccray.com/archive/2007/02/19/Sorta_Nested_Layouts



Vote for John McCain! said over 4 years ago:
McCain for President!