This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
def logged_in? | |
session[:user_id].present? | |
end | |
def require_login | |
unless logged_in? | |
session[:requested_path] = url_for(only_path: true) | |
redirect_to new_authentication_path |