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.
Written by Oliver Petznick
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Did you know?
Account takeover often starts in the browser, on the login page itself. A malicious script can read credentials, tokens, or one-time codes as the person types them.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#