From: "John W. Long" Date: 2003-11-18T13:53:24+09:00 Subject: Re: eRuby and URL rewriting -- "Bermejo, Rodrigo" writes: -- > BTW, I really don't understand why cgi['query'].class => Array ? Because it is possible to specify more than one value for param either in the URL in the case of a GET or in the header in the case of a POST. For example, given the following form:
What kinds of fruit do you like?
Apples
Oranges
Cherries
If you check Apples and Oranges, then press submit the following url will be submitted: http://myurl.com/?fruit=apples&fruit=Oranges So: cgi.params["fruit"] #=> ["apples","oranges"] If you intend to only allow one value to be submitted, just use Array#first: fruit = cgi.params["fruit"].first #=> "apples" I used to think that this was a frustrating syntax, but I now realize this is an essential part of the HTTP spec. ___________________ John Long www.wiseheartdesign.com