aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/base.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2007-11-06 18:33:45 +0000
committerMarcel Molina <marcel@vernix.org>2007-11-06 18:33:45 +0000
commit7863c4a18a4991c4942f52a4f88bbc1bdd9b7572 (patch)
tree02e8f16c49c162a0563f4cd9421ceed2bf02f107 /activeresource/lib/active_resource/base.rb
parent026973f6a06f97b265eb61baa299d3a8f3f737f6 (diff)
downloadrails-7863c4a18a4991c4942f52a4f88bbc1bdd9b7572.tar.gz
rails-7863c4a18a4991c4942f52a4f88bbc1bdd9b7572.tar.bz2
rails-7863c4a18a4991c4942f52a4f88bbc1bdd9b7572.zip
Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/lib/active_resource/base.rb')
-rw-r--r--activeresource/lib/active_resource/base.rb46
1 files changed, 23 insertions, 23 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index b1a79731b9..cc929aaee0 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -14,9 +14,9 @@ module ActiveResource
# Person maps to the resources people, very similarly to Active Record) and a +site+ value, which holds the
# URI of the resources.
#
- # class Person < ActiveResource::Base
- # self.site = "http://api.people.com:3000/"
- # end
+ # class Person < ActiveResource::Base
+ # self.site = "http://api.people.com:3000/"
+ # end
#
# Now the Person class is mapped to RESTful resources located at <tt>http://api.people.com:3000/people/</tt>, and
# you can now use Active Resource's lifecycles methods to manipulate resources.
@@ -26,19 +26,19 @@ module ActiveResource
# Active Resource exposes methods for creating, finding, updating, and deleting resources
# from REST web services.
#
- # ryan = Person.new(:first => 'Ryan', :last => 'Daigle')
- # ryan.save #=> true
- # ryan.id #=> 2
- # Person.exists?(ryan.id) #=> true
- # ryan.exists? #=> true
+ # ryan = Person.new(:first => 'Ryan', :last => 'Daigle')
+ # ryan.save #=> true
+ # ryan.id #=> 2
+ # Person.exists?(ryan.id) #=> true
+ # ryan.exists? #=> true
#
- # ryan = Person.find(1)
- # # => Resource holding our newly create Person object
+ # ryan = Person.find(1)
+ # # => Resource holding our newly create Person object
#
- # ryan.first = 'Rizzle'
- # ryan.save #=> true
+ # ryan.first = 'Rizzle'
+ # ryan.save #=> true
#
- # ryan.destroy #=> true
+ # ryan.destroy #=> true
#
# As you can see, these are very similar to Active Record's lifecycle methods for database records.
# You can read more about each of these methods in their respective documentation.
@@ -48,10 +48,10 @@ module ActiveResource
# Since simple CRUD/lifecycle methods can't accomplish every task, Active Resource also supports
# defining your own custom REST methods.
#
- # Person.new(:name => 'Ryan).post(:register)
+ # Person.new(:name => 'Ryan).post(:register)
# # => { :id => 1, :name => 'Ryan', :position => 'Clerk' }
#
- # Person.find(1).put(:promote, :position => 'Manager')
+ # Person.find(1).put(:promote, :position => 'Manager')
# # => { :id => 1, :name => 'Ryan', :position => 'Manager' }
#
# For more information on creating and using custom REST methods, see the
@@ -61,13 +61,13 @@ module ActiveResource
#
# You can validate resources client side by overriding validation methods in the base class.
#
- # class Person < ActiveResource::Base
- # self.site = "http://api.people.com:3000/"
- # protected
- # def validate
- # errors.add("last", "has invalid characters") unless last =~ /[a-zA-Z]*/
- # end
- # end
+ # class Person < ActiveResource::Base
+ # self.site = "http://api.people.com:3000/"
+ # protected
+ # def validate
+ # errors.add("last", "has invalid characters") unless last =~ /[a-zA-Z]*/
+ # end
+ # end
#
# See the ActiveResource::Validations documentation for more information.
#
@@ -137,7 +137,7 @@ module ActiveResource
# # is requested with invalid values, the response is:
# #
# # Response (422):
- # # <errors><error>First cannot be empty</error></errors>
+ # # <errors type="array"><error>First cannot be empty</error></errors>
# #
#
# ryan.errors.invalid?(:first) #=> true