Turn off Rails Layouts for AJAX Requests

/ Published in: Ruby
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. layout proc{ |c| c.request.xhr? ? false : "application" }

URL: http://artofmission.com/articles/2006/12/20/turn-off-rails-layouts-for-ajax-requests

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.