Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8a01e9d8ea
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (20 sloc) 0.463 kb
class ApplicationController < ActionController::Base
protect_from_forgery
protected
def log_in_user(user_id)
session[:user_id] = user_id
end
def log_out_user
session.clear
session[:user_id] = nil
end
def user_logged_in?
!!current_user
end
def force_user_login
redirect_to login_path unless user_logged_in?
end
def current_user
@current_user ||= session[:user_id] ? User.find(session[:user_id]) : nil
end
end
Jump to Line
Something went wrong with that request. Please try again.