app/controllers/application_controller.rb
#checks if there is a current user, thus verifying whether a user is logged in 
checks if there is a current user, thus verifying whether a user is logged in
checks if there is a current user thus verifying whether a user is logged in
def redirect_if_not_logged_in
      if !logged_in?
        flash[:message] = "You are not logged in."
        redirect '/'
      end
    end
def redirect_if_not_logged_in if ! logged_in? flash [ :message ] = "You are not logged in." redirect '/' end end
checks if there is a current user, thus verifying whether a user is logged in
checks if there is a current user thus verifying whether a user is logged in