From: Prabhas Gupte Date: 2008-04-03T17:01:33+09:00 Subject: Re: ArgumentError even if variable is set Julian Leviston wrote: > That's because your params["numdomains"] is returning a blank array, > so technically it's not empty. to_i is a method of the string class. > > you could put > > params["numdomains"].to_s.to_i > > But I don't know why your numdomains is returning an array?? > > Julian > > > Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO > (#2) OUT NOW! > http://sensei.zenunit.com/ cgi.params is an array. And to_i method does not work on arrays. And contents at each array index are also not strings. Hence, it is needed to convert them to string first and then use to_i. to_s works on any object. -- Posted via http://www.ruby-forum.com/.