Skip to content

Instantly share code, notes, and snippets.

@MilanGrubnic70
Created June 8, 2014 15:30
Show Gist options
  • Save MilanGrubnic70/8bb73b546e3838e0ca2e to your computer and use it in GitHub Desktop.
Save MilanGrubnic70/8bb73b546e3838e0ca2e to your computer and use it in GitHub Desktop.
Helper File
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