The dRuby Book

Chapter 3
Integrating dRuby with eRuby

In this chapter, you’ll learn how to integrate dRuby into ERB, an implementation of the eRuby templating library. eRuby is a templating system used to embed Ruby scripts into documents; it’s handy for creating templates or rendering web pages and is an excellent companion to dRuby. We’ll first learn the basics of eRuby and ERB, and we’ll then work through some examples to integrate them with the Reminder dRuby script we created in Chapter 1, Hello, dRuby.

You may already be familiar with ERB through web frameworks such as Rails; I’ll show you some cool ways of using ERB with dRuby.