On 14 Aug 2011, at 04:27, Samhita wrote:
> 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?
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
-- 
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.