From: Philipp Meier Date: 2002-09-18T18:40:30+09:00 Subject: Re: CGI Parameter Conversion --5PFZVUeDPxlnBcQp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 18, 2002 at 02:44:08AM +0900, Vera, Michael wrote: > i =3D p['count'].to_s.to_i > ^^^^^^^^^ (yuck) > As you can see, I was able to turn this thing into an integer finally, but > it leaves me with two questions: >=20 > 0) Is there a prettier way to do what I am trying to do above? i =3D p['count'].first.to_i i =3D p['count'][0].to_i i =3D p['count'].join().to_i > 1) Why is it an Array, when I thought it would be a key -> value, where > value is a string CGI supports parameter-value pairs where the parameter is not unique. That means you can give multiple values for one parameter. > P.S. What the heck, > 2) What would be the situation where you would want it to be an Array? Checkboxes or multiple selections in a list. -billy. --=20 Meisterbohne S=F6flinger Stra=DFe 100 Tel: +49-731-399 499-0 eL=F6sungen 89077 Ulm Fax: +49-731-399 499-9 --5PFZVUeDPxlnBcQp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9iEo6fBriNoqItSYRAjoiAJ0Qi0C937dVDW1ab16uHiLB1PHpzgCbBNLh Z0l1Nt5+SSlDM1Qzgak1M80= =QuFo -----END PGP SIGNATURE----- --5PFZVUeDPxlnBcQp--