sferik/rails_admin — Issue #845: Foreign key field displaying ID only and not the field name in rails_admin
Author: chandanrekhi
Created: 2011-11-19 04:41:34+00:00
State: open

I have 4 models in my rails application, HQ, Area, Employee, Dealer and all are associated to each other as follows:-

Area belongs_to HQ, HQ has_many areas Employee belongs_to Area, Area has_many Employees Dealer belongs_to Area, Area has_many Dealers

I am using rails_admin to manage all the data. When I create a new Area and select its relevant HQ, the HQ name is displayed in the dropdown list as per the belongs_to association, but when I try to create new Employee or Dealer, the dropdown list for selecting the area shows only the Area ID like Area #1, Area #2 etc., and not its name like A,B,C. Also, when I click on a particular Area name to view its details in rails_admin, the header displays the text, Displaying details for Area "Area #1".

Please guide me, how to fix this issue.