app/helpers/sessions_helper.rb
def log_out
      forget(current_user)
      session.delete(:user_id)
      @current_user = nil
      flash[:success] = "Succesfuly log out!"
      redirect_to root_url
    end
# Logs out the current user.
Logs out the current user.
Logs out the current user .
def log_out
      forget(current_user)
      session.delete(:user_id)
      @current_user = nil
      flash[:success] = "Succesfuly log out!"
      redirect_to root_url
    end
def log_out forget ( current_user ) session . delete ( :user_id ) @current_user = nil flash [ :success ] = "Succesfuly log out!" redirect_to root_url end
Logs out the current user.
Logs out the current user .