提交 b7cccae7 编写于 作者: D Diego Carrion

improved ActiveResource's .element_path and .new_element_path methods...

improved ActiveResource's .element_path and .new_element_path methods documentation by specifing how .site should be declared in order to use prefix_options
上级 66b2dc05
......@@ -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 = {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册