Skip to content
This repository
Browse code

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...
commit dd27e2eec867b2e852e485e07e287188d9d29ad7 1 parent 840246c
Diego Carrion dcrec1 authored vijaydev committed

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. +8 0 activeresource/lib/active_resource/base.rb
8 activeresource/lib/active_resource/base.rb
@@ -637,6 +637,10 @@ def prefix(options={}) "#{prefix_call}" end
637 637 # Post.element_path(1)
638 638 # # => /posts/1.json
639 639 #
  640 + # class Comment < ActiveResource::Base
  641 + # self.site = "http://37s.sunrise.i/posts/:post_id/"
  642 + # end
  643 + #
640 644 # Comment.element_path(1, :post_id => 5)
641 645 # # => /posts/5/comments/1.json
642 646 #
@@ -663,6 +667,10 @@ def element_path(id, prefix_options = {}, query_options = nil)
663 667 # Post.new_element_path
664 668 # # => /posts/new.json
665 669 #
  670 + # class Comment < ActiveResource::Base
  671 + # self.site = "http://37s.sunrise.i/posts/:post_id/"
  672 + # end
  673 + #
666 674 # Comment.collection_path(:post_id => 5)
667 675 # # => /posts/5/comments/new.json
668 676 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.