Topic: controller behaviour

Hi all,

I have a site eg www.productinfo.be . When a user goes to eg www.productinfo.be/car it should show all product info of the product 'car'. 'car' is thus the id of the controller/table product. Default Rails would handle this like www.productinfo.be/product/car but I want to get rid of the /product/ because it always involvs the product.

Can this be done with Rails?

Thanks
Stijn

Re: controller behaviour

Try adding this line to the routes.rb file:

map.connect ':action/:id', :controller => 'product'

Or if you want only the :id to be specified:

map.connect ':id', :controller => 'product', :action => 'show'

Railscasts - Free Ruby on Rails Screencasts