| | 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 | # |
|---|