I am starting to use devise and i want to be able to update a user attribute to online or off line. i have this
class ApplicationController < ActionController::Base
private
def after_sign_in_path_for(resource_or_scope)
#update user status to online
root_path
end
def after_sign_out_path_for(resource_or_scope)
#update user status to offline
root_path
end
end
but i do not no how to write the update method
I’ve done this in the past:
See this question: Devise call backs