Another solution would be to add device_name
and vendor_name
methods to the DeviceModel
and encapsulate that logic there.
↧
Answer by Marc Rohloff for Display related records, if they exist, in Rails view
↧