I have a list of customers but on the filter section on the right column, I get a list like this #<Customer0X0B500>
in the select menu. How can I display the company_name attribute of Customer instead?
Figured it out, thanks!
filter :customer, :collection => proc {(Customer.all).map{|c| [c.company_name, c.id]}}
i'm not sure I understand you but probably you should define to_s method inside your Customer class e.g.
class Customer
def to_s
self.company_name
end
end
it would be easier if you shared some code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With