I've got a route: map.find_stuff "/find_stuff/:near", :controller => "find_stuff", :action => "show"
Where the :near portion is user specified, so when users enter a place with a period, the route doesn't match correctly. So I change it to this: map.find_stuff "/find_stuff/:near", :near => /[^?]*/, :controller => "find_stuff", :action => "show"
This works correctly, the route will grab everything up to the question mark if there is one and put it into the near param.
So my problem now is using the route helpers. If a user specifies find_stuff_path(:near => 'aa?aa') it fails, because a near with a question mark is invalid.
If I pass it in already escaped: find_stuff_path(:near => 'aa%3Faa') the route helper escapes the path itself and I end up with: '/find_stuff/aa%253Faa' where the % has been re-escaped and this does not yield the original value when I get the value out of the params.
Is there any clean way to solve this problem?
Is this a bug where the route segment validation should happen after the escaping instead of before?