Skip to content

Commit

Permalink
Added documentation for using render_with_layout
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Dec 29, 2004
1 parent 60de8c1 commit 1b0da48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions actionpack/lib/action_controller/layout.rb
Expand Up @@ -115,6 +115,22 @@ class << self
# a given action without a layout. Just use the method <tt>render_without_layout</tt>, which works just like Base.render --
# it just doesn't apply any layouts.
#
# == Using a different layout in the action render call
#
# If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above.
# Some times you'll have exceptions, though, where one action wants to use a different layout than the rest of the controller.
# This is possible using <tt>render_with_layout</tt> method. It's just a bit more manual work as you'll have to supply fully
# qualified template and layout names as this example shows:
#
# class WeblogController < ActionController::Base
# def help
# render_with_layout "help/index", "200", "layouts/help"
# end
# end
#
# As you can see, you pass the template as the first parameter, the status code as the second ("200" is OK), and the layout
# as the third.
#
# == Automatic layout assignment
#
# If there is a template in <tt>app/views/layouts/</tt> with the same name as the current controller then it will be automatically
Expand Down

0 comments on commit 1b0da48

Please sign in to comment.