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
15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/sessions_controller.rb', line 15 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
28 29 30 |
# File 'app/controllers/sessions_controller.rb', line 28 def destroy redirect_to signin_path end |