Sinatra was not recognizing a url with a floating point number in it, like
/foo/bar/1.23
This is because Event#initialize uses URI_CHAR = '[^/?:,&#\.]' to build
the pattern to match uri params.
I can monkey-patch around this easily, but what's the right way to
accept params with decimal points?
Also, I'd like to allow commas (which are currently rejected for the
same reason), as in:
/foo/bar/1.23,4.56
Is there any reason not to allow this syntax? It's used for example in
google map urls.
Thanks, and thanks for Sinatra!
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
configure do
#####
# WARNING! SUPER HACK
# Allow dots in path param values
Sinatra::Event.send(:remove_const, "URI_CHAR")
Sinatra::Event.const_set("URI_CHAR", '[^/?:,&#]')
end
Also, what about '?' in urls? Shouldn't sinatra support that?
I did not realize that
get '/test/*' do...end
will not only process cgi params and put them in +params+, but will also
handle decimal points in the values of the params.
Very nice!
> blake.m...@gmail.com <mailto:blake.m...@gmail.com>
It may be interesting to note that Blake is actually a native English
speaker. :)
What's sad is that I understood what you were trying to say there.
--
Ryan Tomayko <http://tomayko.com/>
Btw: my app is a prototype for in-vehicle queries of roadway data
(signage, traffic conditions, etc.) that can be overlaid on a map or
used for audible alerts. [http://www.dot.gov/affairs/rita0107.htm]
> blake.m...@gmail.com <mailto:blake.m...@gmail.com>