Class: Admin::AccountRecoveriesController

Inherits:
AdminController show all
Defined in:
app/controllers/admin/account_recoveries_controller.rb

Instance Attribute Summary

Attributes included from PagesCore::Authentication

#current_user

Instance Method Summary collapse

Methods inherited from PagesCore::AdminController

#redirect, underscore

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

#content_locale

Methods included from PagesCore::ErrorRenderer

#render_error

Methods included from PagesCore::Authentication

#authenticate!, #deauthenticate!, #logged_in?

Instance Method Details

#createObject



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
    (@user)
    flash[:notice] = t("pages_core.account_recovery.sent")
  else
    flash[:notice] = t("pages_core.account_recovery.not_found")
  end
  redirect_to 
end

#newObject



11
# File 'app/controllers/admin/account_recoveries_controller.rb', line 11

def new; end

#showObject



9
# File 'app/controllers/admin/account_recoveries_controller.rb', line 9

def show; end

#updateObject



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 
  else
    render action: :show
  end
end