Re: Restful Route for a custom action

I’m using rails 2.0.2 and yes, I have restarted the server.

What version of Rails?

On Dec 28, 2007 3:10 PM, Mark W. [email protected] wrote:

On Dec 27, 7:21pm, Mark [email protected] wrote:

This is the code in my routes.rb
map.resources :leagues
map.resources :leagues, :collection => {:old => :get}

You restarted the server after changing routes.rb, right? No, of
course you did. Never mind.



The issue is that you do not need to state the routes twice.

map.resources :leagues, :collections => {:old => :get}

is all you need. It will setup the normal restful routes and the
“old” route. By having
the route without the collection in front of it you are overiding the
behavior of the second route.
Simply remove the first route and it should work.