Archive for the ‘HAML’ Category

RailsConf Europe 2006: Use the HAML Luke

Friday, September 15th, 2006

Two punkish lads, one named Hampton Catlin, drinking Stella giving a talk on HAML; a new templating engine for Rails views.

HTML Markup Abstraction Layer. But that doesn’t matter, it just sounds cool as Hampton says.

Like most of us Hampton loves Rails but thinks RHTML is, well, just PHP warmed over.

HAML has principals. The first rule of HAML is… it has to be beautiful. Like the rest of Rails. The second one is XHTML is repetitive and prone to errors. The other two are irrelevant.

So, an example. Before:

<div><p>Hello, World</p></div>

After:

%div
  %p Hello, world

Like YAML it is double-spaced though this will be made flexible eventually.

HAML is like a Haiku, says Hampton.

Scarily, there are no blocks; No loops, no conditions. The simple answer is a list_of helper. Not sure about conditions and control structures yet. I’ll have to give it a shot later.

Ah, the Stella is for his nerves. Brilliant.

One of the best things about HAML is it indents properly. Thank god. RHTML is terrible at that.

Get the plugion at unspace.ca/discover/haml.

An interesting idea overall and it seems to work in most cases.

One thing I have learnt in this conference is that Windows laptops seem to connect better to busy Wifi networks than Macs. Bloody annoying.