0

如何在我的下拉列表中显示每个车辆的布尔活动属性?即凯美瑞-主动吉普-停用雅阁-主动

= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| [o.name, o.id] })

4

2 回答 2

2
= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| ["#{o.name} - #{o.active ? 'active' : 'deactivated'}", o.id] })
于 2013-07-05T18:43:53.287 回答
0
= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| ["#{o.name} - #{o.active}", o.id] })
于 2013-07-05T18:18:11.923 回答