I pulled a number from a database, using the following code:
@all = @m.query("SELECT * FROM OR_TEST3").fetch_row
@count = @all.at(4)
However, this gives me @count=”1″, instead of @count=1, which doesn’t work, because I need to use @count to specify the iterations in a “for” loop. Is there an easy way to make @count a normal number? Sorry, I am new to Ruby.
You convert string to a number with
to_imethodHow are you learning ruby? Every tutorial and book should have this covered.