我是通过if else标签重复输出td完成的,有没有更简洁的写法?
- if match_array[0] == false
td class="success" = obj.shoulder
- else
td = obj.shoulder
- if match_array[1] == false
td class="success" = obj.chest
- else
td = obj.chest
- if match_array[2] == false
td class="success" = obj.arm_relaxed
- else
td = obj.arm_relaxed
改成这样了,求更简洁写法
d = obj.member_name
td class="#{"success" if match_array[0] == false}" = obj.shoulder
td class="#{"success" if match_array[1] == false}" = obj.chest
td class="#{"success" if match_array[2] == false}" = obj.arm_relaxed
td class="#{"success" if match_array[3] == false}" = obj.waist
td class="#{"success" if match_array[4] == false}" = obj.hip
td class="#{"success" if match_array[5] == false}" = obj.thigh
td = edit_with_delete(obj)