Topic: How to remove the name of the controller in the URL?
Hello,
I have a Rails 2.3 application, with a single REST controller named 'articles' and its RESTful route "map.resources :articles".
I can access to some article via the URL http://www.example.com/articles/1.
I would like to get rid of the name of the controller in the URL, ie to access to the article via the URL http://www.example.com/1.
I could do that with
map.connect '/:id', :controller => "articles", :action => "show"
But I would like to get rid of the name of the controller for all my actions, for instance: http://www.example.com/1/edit instead of http://www.example.com/articles/1/edit. Is there a simple/concise way to achieve this?
I tried to use the :as option like this but without success (idem with the :controller option):
map.resources :articles :as => ""
or
map.resources :articles :as => "/"
Thanks by advance ![]()
Florent