vendredi 8 juin 2018

How to end if statement in Haml?

I want to conver this code into Haml, but without "end", whole table becomes a part of "else" condition, not only "tr". How to do this?

`

<% if line_item == @current_item %>
  <tr id="current_item">
<% else %>
  <tr>
<% end %>
    <td><%= line_item.quantity %>&times;</td>
    <td><%= line_item.product.title %></td>
    <td class="item_price"><%= number_to_currency(line_item.total_price) %></td>
  </tr>

`

Aucun commentaire:

Enregistrer un commentaire