Parameters with dots on the URI
- by robertokl
In my application, there is a resource, machine, and a nested resource from machine: ip.
I want to be able to access the URI of an Ip typing the ip address.
The URI should be something like this:
/machines/m123/ips/192.168.0.1.xml
Where "m123" is the name of the machine and "192.168.0.1" is one of the ips of that machine.
The problem here is that rails miss understand the dots from the ip and the format. When I try to access this page, i get:
No route matches "/machines/m123/ips/192.168.0.1.xml"
And if I replace the dots for any other character it works, witch means that rails isn't handling the dots on the URI.
Is there any way to enter a more complex regexp on the routes to make sure rails can treat it the way I want?
I'm using rails 2.3.5 and ruby 1.8.7.
Thank you.