So below is a small structure how I loop items, I want to sort them in my loop from by amount of members to smallest, instead of it being randomly displayed? How should I approach this? Also, if loop contains only 2 elements, how can I set display div to none?
<% for item in @items %>
<%= item.name %>
<%= item.members %>
<% end %>
Aucun commentaire:
Enregistrer un commentaire