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.

///ark

Mark,

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
additional
“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.

–Tim

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs