ylluminate ylluminate - 11 months ago 141
Ruby Question

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?

Answer Source

It's more or less as you described :-)

# use mongoid
class User
  include Mongoid::Document

# then
user = User.where(:email => email).first

if user
  user.password = new_password
  user.password_confirmation = new_password