Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /login POST /sign-in.
-
#destroy ⇒ Object
GET /logout GET /sign-out.
-
#new ⇒ Object
GET /login GET /sign-in.
Instance Method Details
#create ⇒ Object
POST /login POST /sign-in
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/sessions_controller.rb', line 14 def create @session = Challah::Session.new(request, params[:session]) @session.ip = request.remote_ip if @session.save redirect_to return_to_path else redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login') end end |
#destroy ⇒ Object
GET /logout GET /sign-out
27 28 29 |
# File 'app/controllers/sessions_controller.rb', line 27 def destroy redirect_to signin_path end |
#new ⇒ Object
GET /login GET /sign-in
8 9 10 |
# File 'app/controllers/sessions_controller.rb', line 8 def new @session = Challah::Session.new(request) end |