Saturday, 15 September 2012

ruby on rails - devise update attribute after sign out -



ruby on rails - devise update attribute after sign out -

i'm trying update attribute current_user after signing out devise.

if utilize after_sign_out_path_for(resource) current_user nil.

when utilize warden::manager.before_logout works fine when there user signed in.

i have problems because have api , client in same application (client creates, updates, delete, etc through api)

is there way it? maybe custom action?

just idea.

store user id in cookie.

in after_sign_out_path_for(resource) method, find user object cookie , alter attribute.

def after_sign_out_path_for(resource) user = user.find(cookies[:user_id]) user.update_attributes(some_attribute: false) root_path end

ruby-on-rails ruby devise

No comments:

Post a Comment