I'm a beginner in Rails, and I want to know how can I update my database?(I'd like to know all possible options to do it).
I got simple table called USERS, where I got :name and :email attributes.
As i read I can update my :email by:
User.find_by(:id => 1).update_attribute email, "sample@foo.bar"
<- OKUser.find_by(:id => 1).update_attributes :email => "sample@foo.bar"
<- this return to me false
and is there any way to update it by:
@foo = User.find_by(:id => 1)
foo.email = "sample@foo.bar"
foo.save