app.rb
def logged_in?
      if session[:user_id]
        current_user
      else
        flash[:danger] = 'You must be logged in'
        redirect '/login'
      end
    end
# Checks to see the user_id is present in the session
Checks to see the user_id is present in the session
Checks to see the user_id is present in the session
def logged_in?
      if session[:user_id]
        current_user
      else
        flash[:danger] = 'You must be logged in'
        redirect '/login'
      end
    end
def logged_in? if session [ :user_id ] current_user else flash [ :danger ] = 'You must be logged in' redirect '/login' end end
Checks to see the user_id is present in the session
Checks to see the user_id is present in the session