Forum: Ruby on Rails Routing Fixnum

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
eric (Guest)
on 2005-11-13 05:49
(Received via mailing list)
If I have the following route defined:

map.connect '/foo/bar/:baz',
	:requirements => {:baz => /^\d+$/}

then if someone asks for /foo/bar/3 I noticed that :baz == "3" instead
of :baz == 3. I.E. it is a string not a number. (At least it does this
in the functional testing of the routing). This seems reasonable because
I have not told it to expect a number but it would be nice if there was
a way I could specify that. Didn't see anything in the documentation.

Anything I missed or should I just params[:baz].to_i in my controller?

This topic is locked and can not be replied to.