app/controllers/application_controller.rb
# Confirm a logged-in user.
Confirm a logged-in user.
Confirm a logged - in user .
def logged_in_user
      unless logged_in?
        store_location  
        flash[:danger] = "Please log in."
        redirect_to login_url
      end
    end
def logged_in_user unless logged_in? store_location flash [ :danger ] = "Please log in." redirect_to login_url end end
Confirm a logged-in user.
Confirm a logged - in user .
# store location to access after login