Class: Authenticate::SessionsController
- Inherits:
-
AuthenticateController
- Object
- ApplicationController
- AuthenticateController
- Authenticate::SessionsController
- Defined in:
- app/controllers/authenticate/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 10 def create @user = authenticate(params) login(@user) do |status| if status.success? redirect_back_or url_after_create else flash.now.notice = status. render template: 'sessions/new', status: :unauthorized end end end |
#destroy ⇒ Object
22 23 24 25 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 22 def destroy logout redirect_to url_after_destroy end |
#new ⇒ Object
6 7 8 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 6 def new render template: 'sessions/new' end |