【发布时间】:2021-12-08 21:09:24
【问题描述】:
在我的项目中,我想索引数据。
视图代码:
- @phones.each.with_index(1) do |(phone,no_of_duplicate),index|
.row.py-2
.col-2 = index
- if no_of_duplicate.count > 1
.col-3 = phone
.col-3 = no_of_duplicate.count
.col-4 .......................................
- @phones.each.with_index(1) do |(phone,no_of_duplicate),index|
- if no_of_duplicate.count > 1
.row.py-2
.col-2 = index
.col-3 = phone
.col-3 = no_of_duplicate.count
我该如何解决这个问题?
【问题讨论】:
标签: arrays ruby-on-rails ruby