From: Assaf Shomer Date: 2012-11-29T21:35:41+09:00 Subject: Re: CGI question Thanks Ryan, That definitely did the trick. I had no idea that i can just type 'ruby1.9.1' and then type ruby code and CTRL+D executes it. What would be the equivalent thing to do if I'm inside eclipse, that is, how can I see this outputs puked to the console? Thanks again, Assaf. --------------------------------------------- Ryan Davis wrote in post #1086967: > On Nov 28, 2012, at 03:18 , Jan E. wrote: > >> CGI scripts are executed by a webserver like Apache. It makes no sense >> to run them in the console. > > not true: > > 10001 % ruby19 > require 'cgi' > cgi = CGI.new("html3") # add HTML generation methods > cgi.out do > cgi.html do > cgi.head { "\n"+cgi.title { "This Is a Test"} } + > cgi.body do "\n"+ > cgi.form do"\n"+ > cgi.hr + > cgi.h1 { "A Form: " } + "\n"+ > cgi.textarea("get_text") +"\n"+ > cgi.br + > cgi.submit > end > end > end > end > ^d > (offline mode: enter name=value pairs on standard input) > ^d > Content-Type: text/html > Content-Length: 302 > > > This Is a Test >
>

A Form:

> >
-- Posted via http://www.ruby-forum.com/.