是否可以将下面的 ERB 代码转换为 HAML?
再培训局
<div class="users">
<div class="row">
<% i = 0 %>
<% @users.each do |user| %>
<span><%= @user.name %></span>
<% if i % 4 == 0 %>
</div> <!-- Close div .row -->
<div class="row"> <!-- Open new div .row -->
<% end %>
<% i += 1 %>
<% end %>
</div> <!-- Close div .row -->
</div> <!-- Close div .users -->
结果(HTML)
<div class="users">
<div class="row">
<span>User Name 1</span>
<span>User Name 2</span>
<span>User Name 3</span>
<span>User Name 4</span>
</div> <!-- Close div .row -->
<div class="row"> <!-- Open new div .row -->
<span>User Name 5</span>
<span>User Name 6</span>
<span>User Name 7</span>
<span>User Name 8</span>
</div> <!-- Close div .row -->
<div class="row"> <!-- Open new div .row -->
<span>User Name 9</span>
<span>User Name 10</span>
<span>User Name 11</span>
<span>User Name 12</span>
</div> <!-- Close div .row -->
</div> <!-- Close div .users -->