aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_resource_basics.textile
diff options
context:
space:
mode:
authorVishnu Atrai <vishnu.atrai@gmail.com>2011-08-01 20:37:42 +0530
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:13 -0700
commit61899bff17e161dbd706bfb900ac212fe90c3acd (patch)
treefd77f90a0f1e2443940cbc8da4cb7dcceb9c2192 /railties/guides/source/active_resource_basics.textile
parent55296ec0ea4d65f1eb8a41cdd314ba8bc984b2b4 (diff)
downloadrails-61899bff17e161dbd706bfb900ac212fe90c3acd.tar.gz
rails-61899bff17e161dbd706bfb900ac212fe90c3acd.tar.bz2
rails-61899bff17e161dbd706bfb900ac212fe90c3acd.zip
Active Resource - guide for reading and writing data
Diffstat (limited to 'railties/guides/source/active_resource_basics.textile')
-rw-r--r--railties/guides/source/active_resource_basics.textile11
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/guides/source/active_resource_basics.textile b/railties/guides/source/active_resource_basics.textile
index 64f0949475..8a36622814 100644
--- a/railties/guides/source/active_resource_basics.textile
+++ b/railties/guides/source/active_resource_basics.textile
@@ -24,10 +24,21 @@ end
Now the Person class is REST enabled and can invoke REST services very similarly to how Active Record invokes
life cycle methods that operate against a persistent store.
+h3. Reading and Writing Data
+
+Active Resource make request over HTTP using a standard JSON format. It mirrors the RESTful routing built into Action Controller but will also work with any other REST service that properly implements the protocol.
+
+h4. Read
+
+Read requests use the GET method and expect the JSON form of whatever resource/resources is/are being requested.
+
<ruby>
# Find a person with id = 1
ryan = Person.find(1)
+# Check if a person exists with id = 1
Person.exists?(1) # => true
+# Get all resources of Person class
+Person.all
</ruby>
h3. Changelog