Active Resource - guide for update/save

This commit is contained in:
Vishnu Atrai
2011-08-01 20:57:57 +05:30
committed by Xavier Noria
parent 163533b17d
commit eed1026e83

View File

@@ -50,6 +50,16 @@ person = Person.create(:name => 'Vishnu')
person.id # => 1
</ruby>
h4. Update
To update an existing resource, 'save' method is used. This method make a HTTP PUT request in JSON format.
<ruby>
person = Person.find(1)
person.name = 'Atrai'
person.save
</ruby>
h3. Changelog
* July 30, 2011: Initial version by "Vishnu Atrai":http://github.com/vatrai