Hi,
In building hierarchical HTML structures, it's most elegant to use
recursive blocks of haml. Here is a demo recursive haml script:
%html
%body
- p = Proc.new do |data, block|
%ul
- data.each do |l|
%li
- if l.class == Array
- block.call(l, block)
- else
= l
- p.call([[1,2,3],[4,5,6],[7,8,9]], p)
This works, except for one little quibble: the HTML output isn't
indented properly. It renders just fine. What I'd like to know is:
How do I fix the indentation?
Is this the most elegant way to write recursive blocks in haml?
Thanks
Bruce
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---