Rails 3 - small route question

Hi,

resources :car do
resources :wheel
resources :engine do
resources :piston do

so a normal url would be localhost:3000/cars/engines/piston…
I want to rename these objects to something similar localhost:3000/c/e/
p
Basically ONLY in the web url displayed in browser I want these words
car to be replaced with c and wheel with w and engine with e …
Is this possible in Rails 3?

On 14 Aug 2011, at 04:27, Samhita wrote:

p
Basically ONLY in the web url displayed in browser I want these words
car to be replaced with c and wheel with w and engine with e …
Is this possible in Rails 3?

This declaration:

  resources :c, :controller => 'cars'

gives the following routes, as reported by ‘rake routes’:

c_index GET    /c(.:format)            {:action=>"index", 

:controller=>“cars”}
POST /c(.:format) {:action=>“create”,
:controller=>“cars”}
new_c GET /c/new(.:format) {:action=>“new”,
:controller=>“cars”}
edit_c GET /c/:id/edit(.:format) {:action=>“edit”,
:controller=>“cars”}
c GET /c/:id(.:format) {:action=>“show”,
:controller=>“cars”}
PUT /c/:id(.:format) {:action=>“update”,
:controller=>“cars”}
DELETE /c/:id(.:format) {:action=>“destroy”,
:controller=>“cars”}

Chris