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?
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.
精彩评论