in my ApplicationController I want to do something like this:
def layout_by_resource
if user_signed_in? || request.controller == 'ChatRoom'
"application"
else
"unauthorized"
end
end
Is the request.controller == ‘ChatRoom’ part possible? I want to serve a specific layout based on the controller being called by the user.
Thanks
Of course, you could simply replace
request.controller == 'ChatRoom'withparams[:controller] == 'ChatRoom'Alternative solution: