maandag 21 september 2009

Rails: Don't render layout for ajax calls

With one simple line of code you prevent layouts from being loaded for Ajax calls. Just add this line to your application controller of you Ruby on Rails project:




layout proc{ |c| c.request.xhr? ? false : "application" }