» Ruby on Rails: how to render a custom layout in a controller method
Posted by Kasper Tidemann on Tuesday 23rd of February 2010 01:31:59 AM
If you have a controller that uses a general layout, but you want to use a custom layout for one of your controller methods and the corresponding view, what you do is simply to add a render :layout => ‘my_layout’ to the method. Have a look at the below example:
class MyController < ApplicationController
layout ‘main’def my_method
# Do stuff here…
render :layout => ‘my_layout’end
end





