C
Cere Davis
Hi Rubiers,
I can't figure out a way to make the following code do what I want:
#!/usr/bin/ruby1.8 -w
require 'cgi'
cgi=CGI.new("html3")
cgi.out() do
cgi.html() do
cgi.body() do
cgi.form("get") do
cgi.params.to_a.each {|key, val|
cgi.text_field(key, val.to_s) +
cgi.br
} +
cgi.submit("Okey Dokey?")
end
end
end
end
So say I post in something this when I run the script on the command line:
(offline mode: enter name=value pairs on standard input)
lname=davis;fname=cere
../t.cgi:15:in `+': cannot convert String into Array (TypeError)
from ./t.cgi:15
from ./t.cgi:9:in `form'
from ./t.cgi:9
from ./t.cgi:8:in `body'
from ./t.cgi:8
from ./t.cgi:7:in `html'
from /usr/lib/ruby/1.8/cgi.rb:1678:in `html'
from /usr/lib/ruby/1.8/cgi.rb:1678:in `html'
from ./t.cgi:7
from ./t.cgi:6:in `out'
from ./t.cgi:6
What I want to happen is for the cgi script to print the lname and fname
into two text_field boxes but I am having trouble tracing through this
error. Can anyone help?
Thanks,
Cere
I can't figure out a way to make the following code do what I want:
#!/usr/bin/ruby1.8 -w
require 'cgi'
cgi=CGI.new("html3")
cgi.out() do
cgi.html() do
cgi.body() do
cgi.form("get") do
cgi.params.to_a.each {|key, val|
cgi.text_field(key, val.to_s) +
cgi.br
} +
cgi.submit("Okey Dokey?")
end
end
end
end
So say I post in something this when I run the script on the command line:
(offline mode: enter name=value pairs on standard input)
lname=davis;fname=cere
../t.cgi:15:in `+': cannot convert String into Array (TypeError)
from ./t.cgi:15
from ./t.cgi:9:in `form'
from ./t.cgi:9
from ./t.cgi:8:in `body'
from ./t.cgi:8
from ./t.cgi:7:in `html'
from /usr/lib/ruby/1.8/cgi.rb:1678:in `html'
from /usr/lib/ruby/1.8/cgi.rb:1678:in `html'
from ./t.cgi:7
from ./t.cgi:6:in `out'
from ./t.cgi:6
What I want to happen is for the cgi script to print the lname and fname
into two text_field boxes but I am having trouble tracing through this
error. Can anyone help?
Thanks,
Cere