| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- class ProductCat < ActiveRecord::Base
- has_paper_trail
- self.table_name = 'product_cats'
- has_ancestry
- has_many :products, :foreign_key => :category_id
- validates :name,presence:true
-
- rails_admin do
- navigation_label '商品管理'
- weight -240
- nestable_tree({
- position_field: :position,
- max_depth: 2
- })
- list do
- filters [:name,:ancestry,:position]
- field :id
- field :name
- field :position
- field :ancestry
- field :status
- field :cow_state
- field :products
- end
- show do
- field :id
- field :name
- field :position
- field :ancestry
- field :status
- field :cow_state
- field :products
- end
- edit do
- field :name
- field :status
- field :cow_state
- field :products
- end
- end
- end
|