Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SessionsController
- Defined in:
- lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb', line 8 def create if user = User.authenticate_by(params.permit(:email_address, :password)) start_new_session_for user redirect_to after_authentication_url else redirect_to new_session_url, alert: "Try another email address or password." end end |
#destroy ⇒ Object
17 18 19 20 |
# File 'lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb', line 17 def destroy terminate_session redirect_to new_session_url end |
#new ⇒ Object
5 6 |
# File 'lib/rails/generators/rails/authentication/templates/controllers/sessions_controller.rb', line 5 def new end |