mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Added information of how to set element_name in the case the user has a name confliction with an existing model
This commit is contained in:
parent
aad45f920d
commit
0ec7c0a41d
1 changed files with 8 additions and 1 deletions
|
@ -19,7 +19,14 @@ module ActiveResource
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# Now the Person class is mapped to RESTful resources located at <tt>http://api.people.com:3000/people/</tt>, and
|
# 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.
|
# you can now use Active Resource's lifecycles methods to manipulate resources. In the case where you already have
|
||||||
|
# an existing model with the same name as the desired RESTful resource you can set the +element_name+ value.
|
||||||
|
#
|
||||||
|
# class PersonResource < ActiveResource::Base
|
||||||
|
# self.site = "http://api.people.com:3000/"
|
||||||
|
# self.element_name = "person"
|
||||||
|
# end
|
||||||
|
#
|
||||||
#
|
#
|
||||||
# == Lifecycle methods
|
# == Lifecycle methods
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue