DEV Community

Sonford Son
Sonford Son

Posted on

Answer: How to increment ID inside a <%= for %> view helper

works like a charm

 <%= for {item, id} <- Enum.with_index(@items) do %>
     <tr>
     <td><%= id + 1 %></td>
     </tr>
 <% end %>

Top comments (0)