Devise password reset from Rails console

后端 未结 8 984
梦毁少年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 02:05

    You can simply update password field, no need for confirmation password, devise will save it in encrypted form

    u = User.find_by_email('user@example.com')
    u.update_attribute(:password, '123123')
    

提交回复
热议问题