I am trying to display objects in my model as a table, but it is difficult for me to create columns and columns dynamically.
I have a model called "Pictures", and currently I'm showing them all on the looooong list.
<% for picture in @pictures %> <p><%= image_tag(picture.url) %></p> <% end %>
How can I turn this into a table in rails view?
<table> <tr> <% for picture in @pictures %> <td> <%= image_tag(picture.url) %> </td> ** Here where I'm confused..How can I write after 6 cells create a new row?? ***** <% end %> </table>
So, the question is really related to how to break this data type in the view.
source share