Class: Admin::AccountRecoveriesController
- Inherits:
-
AdminController
- Object
- ActionController::Base
- PagesCore::BaseController
- ApplicationController
- PagesCore::AdminController
- AdminController
- Admin::AccountRecoveriesController
- Defined in:
- app/controllers/admin/account_recoveries_controller.rb
Instance Attribute Summary
Attributes included from PagesCore::Authentication
Instance Method Summary collapse
Methods inherited from PagesCore::AdminController
Methods included from PagesCore::StaticCacheController
#disable_static_cache!, #static_cached?
Methods included from PagesCore::PoliciesHelper
#policy, #verify_policy, #verify_policy_with_proc
Methods included from PagesCore::ProcessTitler
inc_number_of_requests, original_title
Methods included from PagesCore::LocalesHelper
Methods included from PagesCore::ErrorRenderer
Methods included from PagesCore::Authentication
#authenticate!, #deauthenticate!, #logged_in?
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/admin/account_recoveries_controller.rb', line 13 def create @user = User.find_by(email: params[:email]) if @user deliver_account_recovery(@user) flash[:notice] = t("pages_core.account_recovery.sent") else flash[:notice] = t("pages_core.account_recovery.not_found") end redirect_to admin_login_url end |
#new ⇒ Object
11 |
# File 'app/controllers/admin/account_recoveries_controller.rb', line 11 def new; end |
#show ⇒ Object
9 |
# File 'app/controllers/admin/account_recoveries_controller.rb', line 9 def show; end |
#update ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/admin/account_recoveries_controller.rb', line 24 def update if user_params[:password].present? && @user.update(user_params) authenticate!(@user) flash[:notice] = t("pages_core.account_recovery.changed") redirect_to admin_login_url else render action: :show end end |