| 123456789101112131415161718192021222324252627282930313233343536373839 |
- class ProductAttrConfig < ActiveRecord::Base
- has_paper_trail
- self.table_name = 'product_attr_configs'
- has_ancestry
- has_many :products, :foreign_key => :category_id
- validates :name,presence:true
-
- rails_admin do
- navigation_label '商品管理'
- weight -250
- parent ProductAttrKey
- nestable_tree({
- position_field: :position,
- max_depth: 2
- })
- list do
- filters [:product_id,:attr_key_id]
- field :id
- field :product_id
- field :attr_key_id
- field :type
- end
- show do
- field :id
- field :product_id
- field :attr_key_id
- field :type
- end
- edit do
- field :product_id
- field :attr_key_id
- field :type
- end
- end
- end
|