aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/README
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-01-24 02:40:32 +0000
committerRick Olson <technoweenie@gmail.com>2007-01-24 02:40:32 +0000
commitf49e449ed5d140b63f30ac046826f81c04e8333d (patch)
tree7821ff304545f96a5cca25e3edff81caea2db3ad /activeresource/README
parent0eb8398cfa6d4abf20c85fa59fa1a284dd992172 (diff)
downloadrails-f49e449ed5d140b63f30ac046826f81c04e8333d.tar.gz
rails-f49e449ed5d140b63f30ac046826f81c04e8333d.tar.bz2
rails-f49e449ed5d140b63f30ac046826f81c04e8333d.zip
Carry over the convenience of #create from ActiveRecord. Closes #7340. [Ryan Daigle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6025 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/README')
-rw-r--r--activeresource/README5
1 files changed, 5 insertions, 0 deletions
diff --git a/activeresource/README b/activeresource/README
index 702ab7efed..696b5e4fed 100644
--- a/activeresource/README
+++ b/activeresource/README
@@ -36,6 +36,11 @@ lifecycle methods that operate against a persistent store.
Person.exists?(ryan.id) #=> true
ryan.exists? #=> true
+ # Resource creation can also use the convenience <tt>create</tt> method which
+ # will request a resource save after instantiation.
+ ryan = Person.create(:first => 'Ryan', :last => 'Daigle')
+ ryan.exists? #=> true
+
# Updating is done with 'save' as well
# PUT http://api.people.com:3000/people/1.xml
#