我想导出报告,但无法弄清楚如何自定义导出选项。
我在RailsAdmin中有两个资源,如下所示
class Shop < ApplicationRecord
belongs_to :location
RailsAdmin.config do |config|
config.model Shop do
export do
field :name
end
end
end
end
我要从中导出报告的Location
class Location < ApplicationRecord
has_many :locations
RailsAdmin.config do |config|
config.model Location do
export do
field :address
field :shops
end
end
end
end
当我导出时,我会在一行中获得所有商店名称的报告
Address Name(Shop)
"Address 1" "Shop1, Shop2, Shop3, ...."
但我想要这样的东西,迭代商店并以单行显示
Address Name(Shop)
"Address 1" "Shop1"
"Address 1" "Shop2"
"Address 1" "Shop3"
任何人都可以提供帮助?通过网络搜索很多没有任何想法。