Guest User

Untitled

a guest
Jun 19th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. I have a resource named Product. In my route file I have map.resources :products. Now I need to do a speed fix so that one of the product id #17 needs to be routed to another action.
  3.  
  4. map.special '/products/17', :controller => 'products', :action => 'foobar'
  5.  
  6. This line of code if above the other one, but I only want it to be run if it's a get reuqest. Otherwise I can't update that product using PUT etc.
  7.  
  8. I have tried :method,:requirements,:only,:expect but still no clue how to solve it.
  9.  
  10. Can someone give me a hint?
Add Comment
Please, Sign In to add comment