overriding restful routes

Hi!   i got those 2 routes: map.preferences '/preferences', :controller => 'preferences', :action => 'new', :requirements => { :method => :get } map.resource :preferences

what i want to do is: - if user type address /preferences it goes to new, instead of index. (this point works) - if method is other than a "get" method, it should do the usual REST action (it doesn't work).

someone know how i do it?

It sounds like you are hacking the singleton resource to fit your url to show as /preferences. I have created a patch that might help you in this case.

http://dev.rubyonrails.org/ticket/10578

But anyway still, with your hack the easiest thing to do would be to use the resources and redirect to new on the GET index.

your patch looks nice.

And i have others question about your patch. does it manage internationalization? i mean /productos/1 and /products/1 would be the same page or just spanish is available?

i just try your patch but doesn't works for me... i don't know why. i'll find the problem.

what error did you get?

I am afraid, it cannot handle internationalisation

ufff feel stupid, it works perfectly (i made a routing error)

Good to know that.

May be you should update the ticket with your experience, so others might benefit. Thanks.