From: "Esteban Manchado Velázquez" Date: 2006-05-15T01:05:53+09:00 Subject: Re: changing the type of a variable --rS8CxjVDS/+yyDmU Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 11, 2006 at 04:02:39AM +0900, Allison Newman wrote: > Hi, >=20 > I'm a ruby newbie, although I'm a programmer with 10yrs experience. I=20 > was running myself through the tutorial in Agile Web Development With=20 > Rails, when I ran into a problem. somewhere in the code I mistakenly=20 > entered >=20 > @items =3D 0 >=20 > instead of >=20 > @items =3D [] >=20 > A bit later I tried the following >=20 > @items << LineItem.for_product(product) >=20 > but when i try to execute this code I got the following error: >=20 > "cannot convert LineItem to Integer" >=20 > Looking back through the code, I found the error mentioned above, and=20 > corrected it. However, Rails still insists that @items is an Integer.=20 > Can anyone suggest what has gone wrong, or what I can do to fix it? Make sure you have actually changed all the "@items =3D 0" occurrences = in the code to the correct version, and also make sure that you aren't passing around (through a form) any "items" variable to the value "0". Are those two lines in some controller action? It's not clear whether they are, or if you're using some external library or something... :-/ --=20 Esteban Manchado Vel=E1zquez - http://www.foton.es EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es --rS8CxjVDS/+yyDmU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFEZ1U3hYgK5b1UDsERAuHQAJ4zP32GinUIo30OpzKOObMc6LCjfgCfbHb2 O1kkAM2/ftLzAeVFM6EmxZ8= =QEk2 -----END PGP SIGNATURE----- --rS8CxjVDS/+yyDmU--