Created
April 26, 2014 07:36
-
-
Save rwoeber/11314156 to your computer and use it in GitHub Desktop.
Simple nested_layout for rails
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
| # via http://grosser.it/2010/02/25/simple-nested_layout-for-rails/ | |
| # application_helper.rb | |
| def nested_layout(layout, &block) | |
| @content_for_layout = capture(&block) | |
| concat(render :file => layout) | |
| end | |
| # layouts/xxxx.erb | |
| <% nested_layout 'layouts/application' do %> | |
| Im nested... | |
| <%= yield %> | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment