What is the easiest way to get started putting your ruby programs in a
web browser, such as the cgi program for Mad Libs. Is there a place I
can get more information on this?
I know a little PHP, not familiar with CGI, I know HTML, XTHML.
What is the easiest way to get started putting your ruby programs in a web browser, such as the cgi program for Mad Libs. Is there a place I can get more information on this?
The PickAxe has a chapter about Ruby as CGI. Then there’s eruby, ERb
(used by Rails), Mongrel…
I know a little PHP, not familiar with CGI, I know HTML, XTHML.
I can tell you this much: eruby is faster than CGI, especially with
mod_ruby for Apache (which is a must), and a lot easier to use, as you
can embed your Ruby code directly into HTML (no need to emit the correct
mime-type, for example).
Admittedly the docs are spotty, but what there is of them is fun, and
camping itself seems straightforward.
The way I understood the OP, the question wasn’t about frameworks (where
Camping, IOWA and Nitro should be mentioned alongside Rails), but about
using Ruby as CGI (which would be needed for the frameworks, anyhow).
What is the easiest way to get started putting your ruby programs
in a web browser, such as the cgi program for Mad Libs. Is there a
place I can get more information on this?
I know a little PHP, not familiar with CGI, I know HTML, XTHML.
It’s very easy indeed. Either use the CGI module, or look at WEBrick
which is great fro rolling your own Application Server. That was one
of the things I demonstrated at RailsConf Europe last year as part of
my brief intro to not using Rails ;p
I really must stick the presentation online sometime, but if you
contact me off-list I’ll e-mail you a copy.
I think the same techniques would also be applicable to Mongrel, but
I’ve not looked at that yet.