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?
Modern devise allows simpler syntax, no need to set the confirmation field
user.password = new_password; user.save
# or
user.update(password: new_password)
# $ rails console production
u=User.where(:email => '[email protected]').first
u.password='userpassword'
u.password_confirmation='userpassword'
u.save!
If you run the following in the rails console it should do the trick:
User.find_by(email: 'user_email_address').reset_password!('new_password','new_password')
http://www.rubydoc.info/github/plataformatec/devise/Devise/Models/Recoverable
You can simply update password field, no need for confirmation password, devise will save it in encrypted form
u = User.find_by_email('[email protected]')
u.update_attribute(:password, '123123')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With