I am trying to map the name attribute from an array of ID's in my index view within active admin.
I have
Sector Model
has_many :portfolio_sectors
has_many :portfolios, through: :portfolio_sectors
Portfolio Model
has_many :portfolio_sectors
has_many :sectors, through: :portfolio_sectors
Portfolio Sector
belongs_to :portfolio
belongs_to :sector
Within active admin, at the moment, I have
# Index
index do
selectable_column
column :sector_ids
actions
end
which will return
[2, 3]
I have the ID's of my sectors. How can I display the name attribute? Using map gives me
undefined method `map` for fixnum 2
How do I access name?