Forum: Ruby on Rails Routing Fixnum

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5190330ad8f1b06d35e2c2da73dc623c?d=identicon&s=25 eric (Guest)
on 2005-11-13 04: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?

Eric
This topic is locked and can not be replied to.