Skip to content

Instantly share code, notes, and snippets.

@cherring
Created May 29, 2012 23:18
Show Gist options
  • Select an option

  • Save cherring/2831407 to your computer and use it in GitHub Desktop.

Select an option

Save cherring/2831407 to your computer and use it in GitHub Desktop.
Hacked create for devise API login
def create
resource = warden.authenticate!(:scope => resource_name, :recall => "new")
respond_to do |format|
format.html do
sign_in_and_redirect(resource_name, resource)
set_flash_message :notice, :signed_in
end
format.xml do
sign_in(resource_name, resource)
render :create
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment