The problem is caused by the fact that Rails is trying to use "dots" to find the format (.:format)
Thus, you can add some restrictions to fix it, for example:
match "/restaurants/near/:lat/:lng(/:range)", :to => "restaurants#near", :as => "near", :constraints => {:lat => /\-?\d+(.\d+)?/, :lng => /\-?\d+(.\d+)?/ , :range => /\d+/}
source share