views:

37

answers:

1

Hi there

I've just started with Rails (having previously worked in Django). The hardest part is working out how to use haml.

I have found the official haml documentation. However, there seems to be no coverage here of syntax - if/else clauses, for loops, etc.

Other than Googling for examples, is there any official documentation of syntax in haml? Or am I missing something obvious?

+3  A: 

HAML doesn't have if/else clauses or loops. HAML allows you to execute any Ruby code that may include those clauses.

In the documentation you referenced, there's a section on Running Ruby which has examples of an each iterator and a case statement. An if is handled in the same way.

Bryan Ash
`for i in array` syntax is also supported, and in most cases the `do` can be omitted.
igorw
evil3: do you have reference showing that HAML syntax?
Bryan Ash
Ah, I see! thanks - different from Django template languages.
AP257