尝试显示嵌套字段而不仅仅是ID。 例如product_catergory_id而不是显示外键1 show" Computers"来自product_catergories / product_catergory(表/字段ID 1)。似乎是关于f.inputs的很多信息,但不是关于列。
product
belongs_to :product_catergories
(has all the foreign keys)
product_catergories
has_many : products
app/admin/products.rb --partial
index do
selectable_column
#my stuff here
column :name
column :product_description
column :product_catergory_id
column :product_colour_id
column :product_size_id
column :supplier_id
actions
end

index do
selectable_column
#my stuff here
column :name
column :product_description
column :product_catergory_id
column "product_catergory_id" do |i|
i.product_catergory.product_catergory
end
column :product_colour_id
column :product_size_id
column :supplier_id
actions
end

答案 0 :(得分:1)
index do
selectable_column
#my stuff here
column :name
column :product_description
column :product_catergory_id
column "product_catergory_id" do |i|
i.product_catergory.product_catergory
end
column :product_colour_id
column :product_size_id
column :supplier_id
actions
end