/ Published in: Ruby
URL: http://artofmission.com/articles/2006/12/20/turn-off-rails-layouts-for-ajax-requests
This allows you to turn off ajax requests application wide, so that you don't have to do render :layout => false in every controller that needs it.
Expand |
Embed | Plain Text
layout proc{ |c| c.request.xhr? ? false : "application" }
Comments
Subscribe to comments
You need to login to post a comment.

This doesn't seem to work in rails 2.0 anymore , this is the updated version:
layout proc{ |c| c.params[:format] == "js" ? false : "blank_page" }