Skip to content

Instantly share code, notes, and snippets.

@mafis
Created March 30, 2011 16:20
Show Gist options
  • Select an option

  • Save mafis/894716 to your computer and use it in GitHub Desktop.

Select an option

Save mafis/894716 to your computer and use it in GitHub Desktop.
#Einfach am Anfang eines Controllers hinzufügen und
#dann kann auf die Methoden nur Zugriffen werden, wenn
#man eingeloggt sind, funktioniert natürlich auch mit :only & :except
before_filter :authenticate_user!
#Gibt zurück ob jemand eingeloggt ist
user_signed_in?
#Gibt den aktuellen eingeloggten Benutzer zurück
current_user
#Gibt die Session des aktuell eingeloggten Benutzer zurück
user_session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment