diff options
author | Vishnu Atrai <vishnu.atrai@gmail.com> | 2011-08-01 20:57:57 +0530 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-04 16:41:29 -0700 |
commit | eed1026e83e04aef4c455a15636dab2e0e28efe3 (patch) | |
tree | b57092e803df4fdf4b819b8ca3070fd510beecd9 | |
parent | 163533b17d968d23eef0023e4c93338d5357d022 (diff) | |
download | rails-eed1026e83e04aef4c455a15636dab2e0e28efe3.tar.gz rails-eed1026e83e04aef4c455a15636dab2e0e28efe3.tar.bz2 rails-eed1026e83e04aef4c455a15636dab2e0e28efe3.zip |
Active Resource - guide for update/save
-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 |