Class: Admin::AccountRecoveriesController

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

Instance Method Summary collapse

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