No route found to match "..." with {:method=>:get}

Hi,

I tried searching Google but didn’t find anything relevant.

When I try to ‘show’ I get the following error:
no route found to match “/pay_files/show/9.0” with {:method=>:get}

However the url “/pay_files/show/9” works fine. The ‘.0’ is causing
the issue.

Thanks for any help.

Sri

When I try to ‘show’ I get the following error:
no route found to match “/pay_files/show/9.0” with {:method=>:get}

However the url “/pay_files/show/9” works fine. The ‘.0’ is causing
the issue.

The dot “.” is a delimiter in routes like slash “/”. You probably
don’t have a route like
:controller/:action/:id.:sth
However, you can add ":id => /./" to the route:
map.connect ‘:controller/:action/:id’, :id => /.
/
This way the id can be of any kind, the route will alway match. But
remember to handle params[:id] properly.

regards, _jan

Jan,

You are right I had one route without the :id => /./
map.connect ‘:controller/:action/:id’, :id => /.
/
but not
map.connect ‘:controller/:action/:id’, :id => /.*/

It did the trick.

Thank you,
Sri