Last Updated: February 25, 2016
·
965
· opetznick

Render Devise Controllers without Layout on XHR Requests

Open your application_controller.rb and add following code:

layout :layout

private

def layout
  request.xhr? && devise_controller? ? false : "application"
end

Your next ajax request will be without layout - just the template.