从后台返回多条数据,然后动态创建checkbox每行显示三列,怎么显示
2条回答 默认 最新
关注随便举个例子:
code="ruby".each_with_index do |user, idx|
<%= h user.name %>
<% if idx > 4 && (idx - 2) % 3 == 0 || idx == 2 %>
<% end %>
end
[/code]本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
关注随便举个例子:
code="ruby".each_with_index do |user, idx|
<%= h user.name %>
<% if idx > 4 && (idx - 2) % 3 == 0 || idx == 2 %>
<% end %>
end
[/code]