Sha256: f277256ea8198baad5f046ee50da53409a6f7cfe2ecad7d8aa76687984eb702e

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

module Adminpanel
  class Item < ActiveRecord::Base
    include Adminpanel::Base

    belongs_to :product
		belongs_to :category
		    
    def self.form_attributes
      [
        {
          'product_id' => {
            'type' => 'belongs_to',
            'label' => 'product',
            'placeholder' => 'product',
            'model' => 'Adminpanel::Product',
          }
        }, 
        {
          'category_id' => {
            'type' => 'belongs_to',
            'label' => 'category',
            'placeholder' => 'category',
            'model' => 'Adminpanel::Category',
          }
        },

      ]
    end

    def self.display_name
      'Item' #singular
    end

    # def self.icon
    #     "truck" # fa-{icon}
    # end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adminpanel-2.1.2 test/dummy/app/models/adminpanel/item.rb