Thursday, January 28, 2010

Ruby on Rails User multiple layouts in single controller

Use multiple layouts in single controller using helpers, one layout per some actions and other for some actions etc..

layout :choose_layout

private
def choose_layout
if [ 'signup', 'login' ].include? action_name
'login'
else
'admin'
end
end

0 comments: