views:

71

answers:

1

How to make form Google.com param (e.g. /some_action/Google.com) a single param, but not "id"=>"Google", "format"=>"com" ?

So i need "id"=>"Google.com"

+6  A: 

You can add some regex requirements to the route parameters.
Here, you want to allow the dots in the parameters.

match 'some_action/:id' => 'controller#action', :constraints  => { :id => /[0-z\.]+/ }

And in rails 2.3 :

map.connect 'some_action/:id', :controller => 'controller', :action => 'action',  :requirements => { :id => /[0-z\.]+/ } 
Damien MATHIEU