I am trying to create urls in the format http: // servername / find / by / CRITERION / VALUE
CRITERION is a finite set of rows equal to VALUE. The problem is that VALUE must be an IP address in some situations, and this causes me a routing error.
Here is my route:
map.find 'find/by/:criterion/:query', :controller => "find", :action => "by"
And the error from the Mongrel logs:
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-07 10:20:32) [GET] ActionController::RoutingError (No route matches "/find/by/ip/1.2.3.4" with {:method=>:get}): Rendering rescues/layout (not_found)
If I find / find / by / foo / bar or / find / by / foo / 1234 I have no problem. I suspect the problem may be with Rails inferring MIME types based on periods in the URL, but I really don't know how this can be disabled. I tried passing the route: defaults => {: format =>: html}, but this causes Mongrel to not start completely.
Any help appreciated!
source share