method
collection_path
v3.2.13 -
Show latest stable
-
0 notes -
Class: ActiveResource::Base
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3 (0)
- 2.1.0 (-1)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (0)
- 3.0.9 (-2)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
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 URLs (e.g., :account_id => 19 would yield a URL like /accounts/19/purchases.json).
-
query_options - A hash to add items to the query string for the request.
Examples
Post.collection_path # => /posts.json Comment.collection_path(:post_id => 5) # => /posts/5/comments.json Comment.collection_path(:post_id => 5, :active => 1) # => /posts/5/comments.json?active=1 Comment.collection_path({:post_id => 5}, {:active => 1}) # => /posts/5/comments.json?active=1