ruby on rails - Does devise have 'callback'? -


After the user logs in, I want to manually log on to this event and want to increase a counter column in the database.

What is something like after_login in devise ? Like ActiveRecord 's before_save ? Devise uses the warden behind the curtain and the warden supplies you with many callbacks:

After_authentication Take a look at the callback that's what you are looking for.

Code:

  Warden :: Manager. After-certification. User, op, opts | # Your code here .. end   

You can just create a new initializer file and enter the code there. (E.g. /config/initializers/warden_callbacks.rb )

Comments