jeudi 21 mai 2015

Devise - after_sign_out_path_for - depending on user attribute

In an earlier version of Devise (3.2) it was possible to access the user that had just signed out in the after_sign_out_path_for(resource) method and redirect according to any given attribute of that user.

In Devise 3.4 the method after_sign_out_path_for(resource_or_scope) just receives the class name as a symbol for the parameter resource_or_scope, i.e. :user in my case.

Is there another way of redirecting a given user after signing out based on the value of an attribute in the user model?

To clarify: I do not intend to create different user classes just for this to work.

Aucun commentaire:

Enregistrer un commentaire