Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.92 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ## routes.rb in a custom gem
  2. Rails.application.routes.draw do
  3.  
  4.   scope "collections",:via=>:get do
  5.      scope "/:id" do
  6.        match "/search"    ,   :to =>  'collections#search', :as => "collection_search"
  7.        match "/facet/:fid",   :to =>  'collections#facet',  :as => "collection_facet"
  8.        match "/:rid",  :to =>  'collections#details',   :as => "collection_item"
  9.      end
  10.   end
  11.   resources :collections, :via=>:get,:only=>[:index]
  12. end
  13.  
  14.  
  15.  
  16. ## results of bundle exec rake routes
  17. collection_search GET /collections/:id/search(.:format)     {:controller=>"collections", :action=>"search"}
  18.  collection_facet GET /collections/:id/facet/:fid(.:format) {:controller=>"collections", :action=>"facet"}
  19.   collection_item GET /collections/:id/:rid(.:format)       {:controller=>"collections", :action=>"details"}
  20.       collections GET /collections(.:format)                {:controller=>"collections", :action=>"index"}