I am trying to figure out how to set the layout from a custom made responder. I want to use the request.xhr? to set the layout for render to 'ajax'. Does anybody know how to do that? I am using Rails 3 and I have a responder like this:
module AjaxLayoutResponder
def to_html
if request.xhr?
# do something here to change layout...
end
super
end
end
It seem to me like a responder is the best way to accomplish this 'ajax' layout switching.