Skip to content
Browse files

improved ActiveResource's .element_path and .new_element_path methods…

… documentation by specifing how .site should be declared in order to use prefix_options
  • Loading branch information...
1 parent 840246c commit dd27e2eec867b2e852e485e07e287188d9d29ad7 @dcrec1 dcrec1 committed with vijaydev Oct 13, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 activeresource/lib/active_resource/base.rb
View
8 activeresource/lib/active_resource/base.rb
@@ -637,6 +637,10 @@ def prefix(options={}) "#{prefix_call}" end
# Post.element_path(1)
# # => /posts/1.json
#
+ # class Comment < ActiveResource::Base
+ # self.site = "http://37s.sunrise.i/posts/:post_id/"
+ # end
+ #
# Comment.element_path(1, :post_id => 5)
# # => /posts/5/comments/1.json
#
@@ -663,6 +667,10 @@ def element_path(id, prefix_options = {}, query_options = nil)
# Post.new_element_path
# # => /posts/new.json
#
+ # class Comment < ActiveResource::Base
+ # self.site = "http://37s.sunrise.i/posts/:post_id/"
+ # end
+ #
# Comment.collection_path(:post_id => 5)
# # => /posts/5/comments/new.json
def new_element_path(prefix_options = {})

0 comments on commit dd27e2e

Please sign in to comment.
Something went wrong with that request. Please try again.