app/models/user.rb
def log_out
    current_user && forget(current_user)
    session.delete(:user_id)
    @current_user = nil
  end
# Logs out the current user.
# https://www.railstutorial.org/book, Hartl Michael, 2014
Logs out the current user.
Logs out the current user .
def log_out
    current_user && forget(current_user)
    session.delete(:user_id)
    @current_user = nil
  end
def log_out current_user && forget ( current_user ) session . delete ( :user_id ) @current_user = nil end
Logs out the current user.
Logs out the current user .