
Untitled
By: a guest on
Aug 3rd, 2012 | syntax:
None | size: 0.92 KB | hits: 13 | expires: Never
## routes.rb in a custom gem
Rails.application.routes.draw do
scope "collections",:via=>:get do
scope "/:id" do
match "/search" , :to => 'collections#search', :as => "collection_search"
match "/facet/:fid", :to => 'collections#facet', :as => "collection_facet"
match "/:rid", :to => 'collections#details', :as => "collection_item"
end
end
resources :collections, :via=>:get,:only=>[:index]
end
## results of bundle exec rake routes
collection_search GET /collections/:id/search(.:format) {:controller=>"collections", :action=>"search"}
collection_facet GET /collections/:id/facet/:fid(.:format) {:controller=>"collections", :action=>"facet"}
collection_item GET /collections/:id/:rid(.:format) {:controller=>"collections", :action=>"details"}
collections GET /collections(.:format) {:controller=>"collections", :action=>"index"}