Writing HTML as Ruby with Markaby
Apress eBooks · 2007
M arkaby—short for “markup as Ruby”—is a Ruby library that lets you output HTML using Ruby code. Whenever you output HTML from a Ruby application, you have a number of options, ranging from manually outputting the HTML with puts statements to using a templating system like erubis (see Chapter 9). Markaby, though, has a distinct advantage over the other options: it turns HTML tags into Ruby methods so that instead of having a mixture of HTML strings and Ruby code, you only have Ruby code. It’s elegant, it’s easy to read, and it gives your entire program a harmonious feel because it’s all pure Ruby code. These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.