Summary

In this 20th day of learning Ruby, we learned about several ways of creating dynamic Web content. Stand-alone scripts (CGI) are the most popular and versatile way to do it, and Ruby provides a CGI class to make it even easier. SHTML or Embedded Ruby makes more sense when you want to insert a small amount of dynamic content (say, a custom access counter) into an otherwise conventional HTML page. In a pinch, you might be able to use Ruby to generate new static pages periodically and so keep them from going out of date.

We didn't do an exhaustive study of Ruby's CGI support or study HTML forms in great depth. We did walk through setting up an Apache Web server in a Unix environment, since so many of the world's Web sites run Apache on Linux. ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.