views:

17

answers:

1

I have a CRUD controller for a model.

Doing resources :foo allows me to route on /foo/:id, etc. for calling actions.

I want add a route for a translation of 'foo' in another language. Let's say 'toto'. So I want all the /toto/:id, etc., routes to act exactly like the /foo/:id, etc., routes.

How may I achieve that?

+1  A: 

You can add a new resource and specify foo as the controller:

resources :toto, :controller=>"foo"

This will point all the actions to "foo", but there is a gotcha. I think you will run into problems with the links on the page, if you are using foo_url or something like that. So you would have to figure out a way to create the URLs dymanically based on the controller in "request.path".

cowboycoded