session creation
This commit is contained in:
parent
0b2bd70f16
commit
f8093d2c09
9 changed files with 63 additions and 3 deletions
|
@ -1,2 +1,10 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
helper_method :current_user
|
||||
helper_method :logged_in?
|
||||
def current_user
|
||||
User.find_by(id: session[:user_id])
|
||||
end
|
||||
def logged_in?
|
||||
!current_user.nil?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue