ruby-on-railsrestresourcesroutes

Can I map resources to a different controller?


I have my resources already defined, but a client wants to change the names of the URLs to match their brand (e.g. something like "catalog" when the resource is currently "products"). Can I specify a different controller name with a resource so I can get all the built-in resources functionality without having to actually rename the controller and model names?


Solution

  • For the record: map.resources :products, :controller => "catalog" is how you do this.