Created
April 7, 2011 10:55
-
-
Save airblade/907555 to your computer and use it in GitHub Desktop.
Nested layouts with HAML in Rails 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def inside_layout(layout = 'application', &block) | |
render :inline => capture_haml(&block), :layout => "layouts/#{layout}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= inside_layout do | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= inside_layout 'some_inner_layout' do | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment