Your first example:
map.getproduct '/getProduct', :controller => 'your_controller', :action => 'your_action'
In the controller you will have catType and color in hash parameters:
params[:catType] => 'toy' params[:color] => 'red'
Is there a better way? Probably yes, but it depends on your needs. If you always have catType and color options, than you can add a route as follows:
map.getproduct '/getProduct/:catType/:color', :controller => 'your_controller', :action => 'your_action'
You will have access to these parameters with the params hash, as in the previous example. And your URLs will look like this:
www.myapp.com/getProduct/toy/red
If your settings can change, you can use routing:
map.getproduct '/getProduct/*query', :controller => 'your_controller', :action => 'your_action'
He will then catch the entire request, having www.my.app.com/getProduct/... at the beginning. But you will have more work in the controller. You will have access to query with this:
params[:query]
and for www.myapp.com/getProduct/color/red/catType/toy it will give:
params[:query] => ['color', 'red', 'catType', 'toy]
So you have to disassemble it manually.