【发布时间】:2018-08-17 13:30:18
【问题描述】:
我从未对课程进行条件应用,所以我有点茫然。
- if @something.elses.all.count > 5
.this-client
- @something.elses.all.each do |thing|
= image_tag thing.photo, class: 'align-middle'
- else
.this-other-client
- @something.elses.all.each do |thing|
= image_tag thing.photo, class: 'align-middle'
RuboCop 真的很讨厌我在两种情况下都有相同的东西,我明白了。那么如何根据结果应用条件类呢?
【问题讨论】: