| 1234567891011121314151617181920212223242526272829303132333435363738 |
- 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 -230
- nestable_tree({
- position_field: :position,
- max_depth: 2
- })
- list do
- filters [:name,:ancestry,:position]
- 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
|