[my controller] this question seems to be similar to one of the question ask on the same topic but it different because the answer given in that is not work for me
i want to update the user profile but when i try to update using the devise gem or override the update action it wouldn't be update it give error password_confirmation can'nt be blank
def update
binding.pry
@user = User.where(:id => current_user.id)
if @user.update(update_params)
render :json => {:user => @user.to_json }
else
render :json => {:error => @user.errors.full_messages.first}
end
end
private
def user_params
params.permit(:first_name, :last_name, :email, :phone_number,:password_confirmation, :password, :city)
end
def update_params
params.permit(:first_name, :last_name,:phone_number, :city)
end
end