Module: Chowder::Rails
- Defined in:
- lib/chowder/rails.rb
Instance Method Summary collapse
- #authorized? ⇒ Boolean
- #current_user ⇒ Object
- #login ⇒ Object
- #logout ⇒ Object
- #require_user ⇒ Object
Instance Method Details
#authorized? ⇒ Boolean
7 8 9 |
# File 'lib/chowder/rails.rb', line 7 def session[:current_user] end |
#current_user ⇒ Object
3 4 5 |
# File 'lib/chowder/rails.rb', line 3 def current_user session[:current_user] end |
#login ⇒ Object
11 12 13 14 |
# File 'lib/chowder/rails.rb', line 11 def login session[:redirect_to] = request.path_info redirect_to '/login' end |
#logout ⇒ Object
16 17 18 |
# File 'lib/chowder/rails.rb', line 16 def logout session[:current_user] = nil end |
#require_user ⇒ Object
20 21 22 |
# File 'lib/chowder/rails.rb', line 20 def require_user login unless end |