Having the following rails view (haml):
.row .span7 %h1 Listing categories %p - @categories.each do |category| .accordion-group .accordion-heading .accordion-toggle{"data-toggle" => "collapse", "data-target" => "##{category.path}"}= link_to category.name, "##{category.path}" - @competitors.each do |category_path, competitors| .accordion-body.table.collapse.in{:id => "#{category_path}"} %table.accordion-inner %thead %tr %th= "Project" %th= "Description" %th= "Watchers" %th= "Forks" %tbody - competitors.each do |competitor| %tr %td = link_to "#{competitor["html_url"]}".sub( "https:\/\/github.com\/", "" ), "#{competitor["html_url"]}" %td %span ยป = competitor["description"] %td %span.badge.badge-info= competitor["watchers"] %td %span.badge.badge-warning= competitor["forks"] I need css class .accordion-group, to contain both .accordion-heading ( which is inside the @categories.each loop ) and .accordion-body (which is inside the other loop: @competitors.each loop). Note the two .each ruby loops, are at the same "node level" in haml, while their css classes .accordion-heading and .accordion-body have to be into .accordion-group css class container. The resoulting html which I need, is like the following: <div class="accordion-group"> <div class="accordion-heading"> <div class="accordion-body in collapse" id="collapse_id"> </div> <div class="accordion-group"> <div class="accordion-heading"> <div class="accordion-body in collapse" id="collapse_id"> </div> <div class="accordion-group"> <div class="accordion-heading"> <div class="accordion-body in collapse" id="collapse_id"> </div> ... ... while I currently get this wrong html code : <div class="accordion-group"> <div class="accordion-heading"> </div> <div class="accordion-group"> <div class="accordion-heading"> </div> <div class="accordion-group"> <div class="accordion-heading"> </div> ... <div class="accordion-body in collapse" id="collapse_id"> <div class="accordion-body in collapse" id="collapse_id"> <div class="accordion-body in collapse" id="collapse_id"> ... I cannot find the right way for indent haml ... -- You received this message because you are subscribed to the Google Groups "Haml" group. To view this discussion on the web visit https://groups.google.com/d/msg/haml/-/oejaSjmM5UYJ. To post to this group, send email to haml@googlegroups.com. To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/haml?hl=en.