Created
April 21, 2009 19:35
-
-
Save jxson/99336 to your computer and use it in GitHub Desktop.
Rails nested layout example
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
| # This is an example of how to use nested layouts in rails per the guide: | |
| # http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts | |
| # in app/views/layouts/application.html.erb (instead of the standard yield) | |
| yield(:content) or yield | |
| # in app/views/layouts/special.html.erb | |
| content_for :content do | |
| # content.. | |
| end | |
| render :file => "layouts/application.html.erb" | |
| # in app/controllers/special_controller.rb | |
| layout 'special' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment