Class: Admin::AdminUsersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/admin_users_controller.rb

Instance Method Summary collapse

Instance Method Details

#update_passwordObject


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/admin/admin_users_controller.rb', line 5

def update_password
  user = resource
  new_password = permitted_params[:password]

  user.password = new_password
  user.password_confirmation = new_password

  if user.save
    if current_admin_user == user
      (user, bypass: true)
    end
    render nothing: true

  else
    render json: user.errors, status: 500

  end
end