Displaying 1 result from an estimated 1 matches for "sign_out_and_redirect".
2011 Nov 02
1
getting devise to return json data when signing out
...they are never logged out. So I want
to be able to log out via curl and return json (curl is my testing
devise right now, but ultimately I intend this to work through the
iphone).
I add this to users/session controller:
def destroy
respond_to do |format|
format.json {
return sign_out_and_redirect(resource_or_scope)
}
end
end
def sign_out_and_redirect(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
if Devise.sign_out_all_scopes
sign_out_all_scopes
else
sign_out(scope)
end
return render :json =&g...