Search code examples
ruby-on-railsrubyruby-on-rails-3deviserails-console

Devise password reset from Rails console


While running an app how do you select a user by email address and then set the password manually within rails console for Devise?

Also, where would I go to review documentation to cover more details in this regard to manipulation of accounts while using Devise?


Solution

  • Modern devise allows simpler syntax, no need to set the confirmation field

    user.password = new_password; user.save
    # or
    user.update(password: new_password)