All these markup generators adopt two principles:
You call a Ruby method to generate an element; it provides the
opening and closing tags and relies on a body to fill in the
To generate a
<foo> element, you call a method named
#1 is correct, and makes Ruby a really nice language for
generating markup. #2 is completely wrong in the general case.
He then goes on to demo code from his own solution. I agree with
this completely — I hate markup-generating libraries that map
tag/element names to methods.