Skip to content
Snippets Groups Projects
Verified Commit de582ab3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix user params when edit from admin area

parent aa25c0ff
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -59,15 +59,17 @@ class Admin::UsersController < Admin::ApplicationController
end
 
def update
user_params_with_pass = user_params.dup
if params[:user][:password].present?
user_params.merge(
user_params_with_pass.merge!(
password: params[:user][:password],
password_confirmation: params[:user][:password_confirmation],
)
end
 
respond_to do |format|
if user.update_attributes(user_params)
if user.update_attributes(user_params_with_pass)
user.confirm!
format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' }
format.json { head :ok }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment