Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 272

Show
Ignore:
Timestamp:
12/29/04 13:36:27 (3 years ago)
Author:
david
Message:

Added documentation for using render_with_layout

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/layout.rb

    r220 r272  
    116116    # it just doesn't apply any layouts. 
    117117    # 
     118    # == Using a different layout in the action render call 
     119    #  
     120    # If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. 
     121    # Some times you'll have exceptions, though, where one action wants to use a different layout than the rest of the controller. 
     122    # 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 
     123    # qualified template and layout names as this example shows: 
     124    # 
     125    #   class WeblogController < ActionController::Base 
     126    #     def help 
     127    #       render_with_layout "help/index", "200", "layouts/help" 
     128    #     end 
     129    #   end 
     130    # 
     131    # As you can see, you pass the template as the first parameter, the status code as the second ("200" is OK), and the layout 
     132    # as the third. 
     133    # 
    118134    # == Automatic layout assignment 
    119135    #