我想要自定义索引页面,比如基于id的显示细节。例如,我有两张桌子,像商人和顾客
merchant.rb
class Merchant < ActiveRecord::Base
has_many :customers
end
customer.rb
class Customer < ActiveRecord::Base
belongs_to :merchant
end
现在我的代码就像
app/admin/merchant.rb
index do
selectable_column
column :merchant_id
column :name