app/controllers/application_controller.rb
# check if the user is logged in
check if the user is logged in
check if the user is logged in
def logged_in_user
            unless logged_in?
            store_location
            flash[:danger] = "Please log in to access this page"
            redirect_to login_url
            end
        end
def logged_in_user unless logged_in? store_location flash [ :danger ] = "Please log in to access this page" redirect_to login_url end end
check if the user is logged in
check if the user is logged in