diff options
author | Vishnu Atrai <vishnu.atrai@gmail.com> | 2011-08-01 20:57:57 +0530 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:13 -0700 |
commit | 212654be02e28ee97d75819b0f799ccb6f7b9130 (patch) | |
tree | 521774ac5022e6fd723a3607d280eb92292384ad /railties | |
parent | aa9da1fe70a109f86922b4ee83039f1cae1e6584 (diff) | |
download | rails-212654be02e28ee97d75819b0f799ccb6f7b9130.tar.gz rails-212654be02e28ee97d75819b0f799ccb6f7b9130.tar.bz2 rails-212654be02e28ee97d75819b0f799ccb6f7b9130.zip |
Active Resource - guide for update/save
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/active_resource_basics.textile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/guides/source/active_resource_basics.textile b/railties/guides/source/active_resource_basics.textile index e40ca4fc42..1115b9848f 100644 --- a/railties/guides/source/active_resource_basics.textile +++ b/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
\ No newline at end of file |