0
votes

I want to update users password without password_confirmation in devise. In case password field is blank - password don't change. How could I do this with devise? Maybe use required_password?

3

3 Answers

1
votes

it is not necessary to enter, password:

  def password_required?
    !persisted? || !password.nil? || !password_confirmation.nil?
  end

https://github.com/plataformatec/devise/blob/master/lib/devise/models/validatable.rb

string - 49

0
votes

latest rails 6 solution:

  def update_resource(resource, params)
    resource.update(params)
  end

in your registrations_controller.rb file