lib/gemcache/ruby/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb
# 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 <tt>/photos/search</tt>
# with GET, and route to the search action of +PhotosController+. It will also
# create the <tt>search_photos_url</tt> and <tt>search_photos_path</tt>
# route helpers.
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.
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 .
def collection
          unless resource_scope?
            raise ArgumentError, "can't use collection outside resource(s) scope"
          end
          with_scope_level(:collection) do
            scope(parent_resource.collection_scope) do
              yield
            end
          end
        end
def collection unless resource_scope? raise ArgumentError , "can't use collection outside resource(s) scope" end with_scope_level ( :collection ) do scope ( parent_resource . collection_scope ) do yield end end end
To add a route to the collection:
resources :photos do
collection do
get 'search'
end
end
To add a route to the collection : resources : photos do collection do get ' search ' end end