aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorVishnu Atrai <vishnu.atrai@gmail.com>2011-07-30 18:23:05 +0530
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:11 -0700
commit95c2230f0577c8f3ef2312fe9268dc9c0ed3bf8a (patch)
tree96a8a9fbbfb13b4a62bb38ec673639bddf908f09 /railties/guides
parent5da1ddb7506d4dc1b314f6634e4c28e13e6eeaa2 (diff)
downloadrails-95c2230f0577c8f3ef2312fe9268dc9c0ed3bf8a.tar.gz
rails-95c2230f0577c8f3ef2312fe9268dc9c0ed3bf8a.tar.bz2
rails-95c2230f0577c8f3ef2312fe9268dc9c0ed3bf8a.zip
configuration for active resource
Diffstat (limited to 'railties/guides')
-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 5cf22f8e39..f0cd25bfc2 100644
--- a/railties/guides/source/active_resource_basics.textile
+++ b/railties/guides/source/active_resource_basics.textile
@@ -10,6 +10,17 @@ h3. Introduction
Active Resource allows you to connect with RESTful web services. So, in Rails, Resource classes inherited from +ActiveResource::Base+ and live in +app/models+.
+h3. Configuration and Usage
+
+Putting Active Resource to use is very similar to Active Record. It's as simple as creating a model class
+that inherits from ActiveResource::Base and providing a <tt>site</tt> class variable to it:
+
+<ruby>
+class Person < ActiveResource::Base
+ self.site = "http://api.people.com:3000/"
+end
+</ruby>
+
h3. Changelog
* July 30, 2011: Initial version by "Vishnu Atrai":http://github.com/vatrai \ No newline at end of file