# encoding: utf-8
class AdPosition < ActiveRecord::Base
  has_paper_trail
  self.table_name = "ad_positions"
  has_many :ad_items
  validates :code,:name,:remark,presence: true

  rails_admin do
    navigation_label '广告渠道管理'
    weight -500
    list do
      filters [:name,:state]
      field :id
      field :code
      field :ad_items
      field :name
      # field :img
      field :click_url
      field :click_times
      field :state
      field :remark
      field :created_at
      # field :updated_at
    end
    show do
      field :id
      field :code
      field :ad_items
      field :name
      field :img
      field :click_url
      field :click_times
      field :state
      field :remark
      field :created_at
      # field :updated_at
    end
    edit do
      field :code
      field :ad_items
      field :name
      field :img
      field :click_url
      # field :click_times
      field :state
      field :remark    
    end

  end

end
