Browse files

Active Resource - guide for update/save

  • Loading branch information...
1 parent 163533b commit eed1026e83e04aef4c455a15636dab2e0e28efe3 @vatrai vatrai committed with fxn Aug 1, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 railties/guides/source/active_resource_basics.textile
View
10 railties/guides/source/active_resource_basics.textile
@@ -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

0 comments on commit eed1026

Please sign in to comment.