update_attributes is an instance method, not a class method, so you must first call it on an instance of the User class.
Get the user you want to update: for example, Suppose you want to update the user with id 1
@user = User.find_by(id: 1) now if you want to update the user name and password, you can do
or
@user.update(name: "ABC", pass: "12345678")
or
@user.update_attributes(name: "ABC", pass: "12345678")
Use it accordingly in your case.
For more information, you can refer to Ruby on Rails Guides .
You can use the update_all method to update all records. This is a class method, so you can name it as The following code will update the name of all user entries and set it to "ABC" User.update_all (name: "ABC")
source share