views:

47

answers:

1

Hi,

In the rails config/routes.rb file, how do I ensure that the first route here takes all characters after the initial /site and uses this for this route (assigning it to :path).

  map.connect 'sites/:path', :controller => 'xxx', :action => 'yyy'
  map.connect ':controller/:action/:id'

In other words how to avoid any URL that goes http://mysite/sites/, to be missed by the first route and then picked up by the second route?

thanks

+1  A: 

Put the second route first or..

use Route Globbing (Section 4.9)?

Ryan Bigg
excellent - thanks
Greg