Class: Admin::PasswordResetsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Admin::PasswordResetsController
- Defined in:
- lib/generators/admin/install/templates/controllers/admin/password_resets_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/generators/admin/install/templates/controllers/admin/password_resets_controller.rb', line 14 def create if @user = Admin::User.find_by(email: params[:email]) send_password_reset_email redirect_to admin_sign_in_path, notice: "Check your email for reset instructions" else redirect_to new_admin_password_reset_path, alert: "Sorry, we didn't recognize that email address" end end |
#edit ⇒ Object
11 12 |
# File 'lib/generators/admin/install/templates/controllers/admin/password_resets_controller.rb', line 11 def edit end |
#new ⇒ Object
8 9 |
# File 'lib/generators/admin/install/templates/controllers/admin/password_resets_controller.rb', line 8 def new end |
#update ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/generators/admin/install/templates/controllers/admin/password_resets_controller.rb', line 23 def update if @user.update(user_params) redirect_to admin_sign_in_path, notice: "Your password was reset successfully. Please sign in" else redirect_to edit_admin_password_reset_path(token: params[:token]), alert: @user.errors.first. end end |