This project is archived and is in readonly mode.
router.rb match and :format problem
-
Neeraj Singh
- Importance changed from to Low
In routes pass :format => false and then use your regexp to match the incoming data.
-
Todor Dragnev
Ok, I change my route to
match "check/car/:car_number/:latitude/:longitude/:timestamp/:images_count",
:controller => :check, :action => :car, :format => false
Output from rake routes is:
/check/car/:car_number/:latitude/:longitude/:timestamp/:images_count {:action=>"car", :controller=>"check"}Then execute test command still have error:
curl http://localhost:3000/check/car/MC89B/4313046/27.901795/12.91830451/2
No route matches /check/car/MC89B/4313046/27.901795/12.91830451/2
When remove dots from request
curl http://localhost:3000/check/car/MC89B/4313046/27901795/1291830451/2
All is Ok.
-
Andrew White
- State changed from new to invalid
Todor, by default . is not allowed in dynamic segments - you need to supply a regexp to override this:
get '/location/:lat/:lng', :to => 'maps#show', :lat => %r{[^/]+}, :lng => %r{[^/]+}, :format => falseThis crops up frequently - see my response to #5994. I really must get around to adding something to the guides.