Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v6.0.0) is shown here.
These similar methods exist in v7.1.3.2:
collection()
public
To add a route to the collection:
resources :photos do
collection do
get 'search'
end
end
This will enable Rails to recognize paths such
as /photos/search with GET, and route to the search action of
PhotosController. It will also create the
search_photos_url and search_photos_path route helpers.
Show source
def collection
unless resource_scope?
raise ArgumentError, "can't use collection outside resource(s) scope"
end
with_scope_level(:collection) do
path_scope(parent_resource.collection_scope) do
yield
end
end
end