O'Reilly logo

Ruby by Example by Kevin C. Baird

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

#42 Mod Ruby (mod_ruby_demo.rhtml and mod_ruby_demo.conf)

CGI is great for many applications. However, sometimes you may want to have files that are mainly HTML, with only subsections that need to be executed by your programming language, Ruby or otherwise. Wouldn’t it be great if you had an HTML tag that meant Start Ruby code now, after which you could add some Ruby code, and then use another tag that meant Done with Ruby code, go back to plain old HTML?

There is such a system, for many languages. It’s the default behavior for the PHP language, and similar systems are available for Perl and Python, among others. One of the systems that does this for Ruby is eRuby, which will be embedded directly within the webserver via the mod_ruby software. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required