title: How do i update a user attribute after signing in and signing out with devise gem
body: <p>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</p>
  
  <pre><code>class ApplicationController &lt; 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
  </code></pre>
  
  <p>but i do not no how to write the update method</p>