On Wed, Aug 20, 2008 at 5:03 PM,  <brabuhr / gmail.com> wrote:
> On Wed, Aug 20, 2008 at 4:25 PM, Nick Brown
> <ruby-forum.com / nick-brown.com> wrote:
>> F. Senault wrote:
>>> Please provide some code to demonstrate this.
>>
>> a = cgi['a']
>
> Internal to the CGI object, it appears that "a" in the @params hash is
> an array of strings not a string:
>
> irb(main):007:0> cgi = CGI.new('html4')
> (offline mode: enter name=value pairs on standard input)
> a=foohibyebar
> => #<CGI:0xb7c998cc @params={"a"=>["foohibyebar"]}, @multipart=false,
> @output_cookies=nil, @output_hidden=nil, @cookies={}>

> ruby z.rb
z.rb:7: warning: don't put space before argument parentheses
(offline mode: enter name=value pairs on standard input)
a=foohibybar
a=zizzlesticks
z.rb:13:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array,
use cgi.params['key']
Inserting value a=foobyebybar into the database.
What was actually inserted into the database: foobyebybar