C
Cere Davis
Hello Ruby cgi geniuses,
I cannot figure out how to print html content within the same scope as
the cgi.xx object. That is: When I try and run this:
cgi.out() do
cgi.html() do
cgi.body() do
p userinfo.to_s
cgi.form("get") do
cgi.br +
cgi.params.map {|key, val|
key + " " +
cgi.text_field(key, val) +
cgi.br
}.join +
cgi.br +
cgi.submit("Does this look ok?")
end
end
end
end
I get all the html written before the Content-Type and Content-length
headers get printed...which of course kills my script. If I move the 'p
userinfo.to_s' to after the cgi.submit then the script prints all of
cgi.xx html along with the userinfo data above the Content-Type:
headers. Does anyone know how to shim your own html into the cgi object
so that it will run correctly?
Thanks,
Cere
I cannot figure out how to print html content within the same scope as
the cgi.xx object. That is: When I try and run this:
cgi.out() do
cgi.html() do
cgi.body() do
p userinfo.to_s
cgi.form("get") do
cgi.br +
cgi.params.map {|key, val|
key + " " +
cgi.text_field(key, val) +
cgi.br
}.join +
cgi.br +
cgi.submit("Does this look ok?")
end
end
end
end
I get all the html written before the Content-Type and Content-length
headers get printed...which of course kills my script. If I move the 'p
userinfo.to_s' to after the cgi.submit then the script prints all of
cgi.xx html along with the userinfo data above the Content-Type:
headers. Does anyone know how to shim your own html into the cgi object
so that it will run correctly?
Thanks,
Cere