Class: Morpho::PasswordsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Morpho::PasswordsController
- Defined in:
- app/controllers/morpho/passwords_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/morpho/passwords_controller.rb', line 6 def create if user user.deliver_reset_password_instructions! flash.now[:notice] = I18n.t('morpho.messages.passwords.create.success') render :new else flash.now[:error] = I18n.t('morpho.messages.passwords.create.failure') render :new end end |
#edit ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/morpho/passwords_controller.rb', line 17 def edit unless user flash.now[:error] = I18n.t('morpho.messages.passwords.edit.failure') render :new end end |
#update ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/morpho/passwords_controller.rb', line 24 def update if user.update_attributes(password_params) user.change_password!(password_params[:password]) redirect_to sign_in_path, success: I18n.t('morpho.messages.passwords.update.success') else flash.now[:error] = I18n.t('morpho.messages.passwords.update.failure') render :edit end end |