Class: PasswordsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PasswordsController
- Defined in:
- app/controllers/passwords_controller.rb
Instance Method Summary collapse
-
#edit ⇒ Object
From for user to update password.
-
#update ⇒ Object
Update user’s password.
Instance Method Details
#edit ⇒ Object
From for user to update password
9 10 11 12 |
# File 'app/controllers/passwords_controller.rb', line 9 def edit redirect_to(new_session_path) unless user.matches_verification_token?(token) # render passwords/edit.html.erb end |
#update ⇒ Object
Update user’s password
15 16 17 18 19 20 21 |
# File 'app/controllers/passwords_controller.rb', line 15 def update if user.secure_update(token, password_params.merge(password_required: true)) redirect_to new_session_path, notice: t(".notice") else render :edit end end |