Devise password reset from Rails console

后端 未结 8 970
梦毁少年i
梦毁少年i 2021-01-30 01:38

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

8条回答
  •  一整个雨季
    2021-01-30 01:51

    # $ rails console production
    u=User.where(:email => 'usermail@gmail.com').first
    u.password='userpassword'
    u.password_confirmation='userpassword'
    u.save!
    

提交回复
热议问题