Manually output HAML start and end tags

Posted by trobrock on Stack Overflow See other posts from Stack Overflow or by trobrock
Published on 2010-05-30T22:45:10Z Indexed on 2010/05/30 22:52 UTC
Read the original article Hit count: 194

Filed under:
|
|

I have some code:

- count = 0
- @clients.each do |client|
  %div{:class => "grid_2#{(" alpha" if (count % 3) == 0) || (" omega push_2" if (count % 3) == 2) || " push_1"}"}= link_to h(client.name), client    
  - count += 1

I want to output an opening div tag right after the each statement if the (count % 3) == 0 and out put the end tag at the end of the block if the (count % 3) == 2 but I can't figure out how to get HAML to do this. Any ideas?

© Stack Overflow or respective owner

Related posts about html

Related posts about ruby-on-rails