method

collection_path

Importance_2
v2.0.3 - Show latest stable - 0 notes - Class: ActiveResource::Base
collection_path(prefix_options = {}, query_options = nil) public

Gets the collection path for the REST resources. If the query_options parameter is omitted, Rails will split from the prefix_options.

Options

prefix_options:A hash to add a prefix to the request for nested URL’s (e.g., :account_id => 19 would yield a URL like /accounts/19/purchases.xml).
query_options:A hash to add items to the query string for the request.

Examples

  Post.collection_path
  # => /posts.xml

  Comment.collection_path(:post_id => 5)
  # => /posts/5/comments.xml

  Comment.collection_path(:post_id => 5, :active => 1)
  # => /posts/5/comments.xml?active=1

  Comment.collection_path({:post_id => 5}, {:active => 1})
  # => /posts/5/comments.xml?active=1
Show source
Register or log in to add new notes.