Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<%- array = [1,2,3,4,5,6,7] %>
<%- grouped = array.in_groups(3) %>
<table>
<% grouped.first.each_with_index do |first_col, index| %>
<tr>
<td><%= first_col %></td>
<td><%= grouped[1][index] %></td>
<td><%= grouped[2][index] %></td>
</tr>
<% end %>
</tabl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.