| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- class ProductAttr < ActiveRecord::Base
- has_paper_trail
- self.table_name = 'product_attrs'
- has_ancestry
- has_many :product_attr_keys, :foreign_key => :attr_key_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 [:name,:ancestry,:position]
- field :id
- field :product_attr_key
- field :name
- field :recommend
- end
- show do
- field :id
- field :product_attr_key
- field :name
- field :recommend
- end
- edit do
- field :product_attr_key
- field :name
- field :recommend
- end
- end
- end
|