By default, Rails 3 interprets a dot in a URL as a format specifier. For example, given the route
match "/foo/:search"
and the URL /foo/bar.baz, this would result in the following parameters being passed:
{ :search => "bar", :format => "baz" }
This may not be what you desire, so here is a quick workaround, using segment constraints:
match "/foo/:search", :constraints => { :search => /[^\/]*/ }
The constraint for the :search parameter now matches anything but a slash, which includes the dot, and Rails will no longer interpret it as a format.
Thanks to this guy, who led me in the right direction.
[...] is a small update on a blog post which I wrote back on my old blog. Still need to find a way to move all those articles over to this [...]
Incredible man! Exactly what I was looking for! Thanks