Skip to content

Instantly share code, notes, and snippets.

@edison
Created January 28, 2015 01:11
Show Gist options
  • Save edison/c156c3858ea6cb39486d to your computer and use it in GitHub Desktop.
Save edison/c156c3858ea6cb39486d to your computer and use it in GitHub Desktop.
Devise Sessions Controller for Ajax
class Website::SessionsController < ::Devise::SessionsController
respond_to :js
layout false
# POST /resource/sign_in
def create
self.resource = warden.authenticate(auth_options)
if resource && resource.active_for_authentication?
sign_in(resource_name, resource)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment