When you create a web application with Rails, using devise makes it easy to create a login authentication part.
By using devise, the user's password is encrypted and stored.
There are times when you want to change your password by directly modifying data as you are developing.
In that case, do as follows.
user = User.find(ID of the user whose password you want to change) user.password = 'new password' user.password_confirmation = 'new password' user.save