Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SessionsController
- Defined in:
- lib/branston/app/controllers/sessions_controller.rb,
lib/branston/test/functional/sessions_controller_test.rb
Overview
Re-raise errors caught by the controller.
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#new ⇒ Object
render new.rhtml.
- #rescue_action(e) ⇒ Object
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/branston/app/controllers/sessions_controller.rb', line 24 def create logout_keeping_session! user = User.authenticate(params[:login], params[:password]) if user # Protects against session fixation attacks, causes request forgery # protection if user resubmits an earlier form using back # button. Uncomment if you understand the tradeoffs. # reset_session self.current_user = user = (params[:remember_me] == "1") redirect_back_or_default('/') flash[:notice] = "Logged in successfully" else note_failed_signin @login = params[:login] @remember_me = params[:remember_me] render :action => 'new' end end |
#destroy ⇒ Object
45 46 47 48 49 |
# File 'lib/branston/app/controllers/sessions_controller.rb', line 45 def destroy logout_killing_session! flash[:notice] = "You have been logged out." redirect_back_or_default('/') end |
#new ⇒ Object
render new.rhtml
21 22 |
# File 'lib/branston/app/controllers/sessions_controller.rb', line 21 def new end |
#rescue_action(e) ⇒ Object
5 |
# File 'lib/branston/test/functional/sessions_controller_test.rb', line 5 def rescue_action(e) raise e end |