Class: EasyAdmin::ProfileController

Inherits:
ApplicationController show all
Includes:
TwoFactor
Defined in:
app/controllers/easy_admin/profile_controller.rb

Instance Method Summary collapse

Methods included from TwoFactor

#change_password, #regenerate_backup_codes, #two_factor_backup_codes, #two_factor_enable, #two_factor_setup, #update_password

Methods inherited from ApplicationController

#policy_for

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/easy_admin/profile_controller.rb', line 5

def index
  @user = current_admin_user
end

#updateObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/easy_admin/profile_controller.rb', line 9

def update
  @user = current_admin_user
  
  if @user.update(profile_params)
    redirect_to profile_path, notice: 'Profile updated successfully'
  else
    redirect_to profile_path, alert: 'Failed to update profile'
  end
end