Created
June 8, 2014 15:30
-
-
Save MilanGrubnic70/8bb73b546e3838e0ca2e to your computer and use it in GitHub Desktop.
Helper File
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
helpers do | |
def current_user | |
User.find_by_id(session[:user_id]) | |
end | |
def login_user(user) | |
sesson[:user_id] = user.id | |
end | |
def logout_user | |
session.delete(:user_id) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment