mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Active Resource - guide for update/save
This commit is contained in:
committed by
Xavier Noria
parent
aa9da1fe70
commit
212654be02
@@ -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
|
||||
Reference in New Issue
Block a user