class Customer def display_name self.company_name end end
Defining the name display_name instead of to_s works better ...
- to_s can be called automatically by other objects.
- display_name only affects ActiveAdmin
You can also define:
show :title => :display_name
This will cause your company name to appear as the name on the watch pages, not Company #x.
source share