Reputation: 6459
How do I show the boolean active attribute for each Vehicle in my dropdown? i.e. camry - active jeep - deactivated accord - active
= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| [o.name, o.id] })
Upvotes: 0
Views: 31
Reputation: 5734
= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| ["#{o.name} - #{o.active ? 'active' : 'deactivated'}", o.id] })
Upvotes: 2
Reputation: 2517
= select("drivers_vehicle", "vehicle_id", Vehicle.accessible_by(current_ability).all.collect { |o| ["#{o.name} - #{o.active}", o.id] })
Upvotes: 0