Forum: Ruby on Rails RE: beer

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.
Berger, Daniel (Guest)
on 2006-03-29 23:31
(Received via mailing list)
> I have one string in my controller but i need to knwon how i
> verify if it is numerical

if string =~ /^\d+$/

Another option is to use Integer(str) and check for an error.

What this has to do with beer, I'm not sure.


This topic is locked and can not be replied to.