Sha256: 13d28e8fa36eb571531a09f8efef81e92626f97aa65923970b43140b783c91ef
Contents?: true
Size: 397 Bytes
Versions: 35
Compression:
Stored size: 397 Bytes
Contents
class ApplicationController < ActionController::Base protect_from_forgery helper_method :current_user def current_user # session[:user_id] = User.first.id @current_user ||= User.find_by_id(session[:user_id]) end def login_required unless current_user flash[:warn] = "You must be logged in to view that page!" redirect_to root_url end end end
Version data entries
35 entries across 35 versions & 1 rubygems