Sha256: 407a0e3fd285059b267a3c1ff3e36f5b0ad750e0f32e0885e2dcce22b539458c

Contents?: true

Size: 1.17 KB

Versions: 17

Compression:

Stored size: 1.17 KB

Contents

module Adminpanel
  class TestObject < ActiveRecord::Base
    include Adminpanel::Base
    has_and_belongs_to_many :categories,
        join_table: "adminpanel_test_object_category"

    mount_images :textfiles

    def self.form_attributes
      [
        {
          'name' => {
            'type' => 'text_field',
            'label' => 'name'
          }
        },
        {
          'category_ids' => {
            'type' => 'checkbox',
            'options' => Proc.new { |object|
              Adminpanel::Category.all.map { |o| [o.id, o.name] }
            }
          }
        },
        {
          'boolean' => {
            'type' => 'boolean',
            'label' => 'boolean'
          }
        },
        {
          'text' => {
            'type' => 'wysiwyg_field',
            'uploader' => 'textfiles',
            'label' => 'wysi'
          }
        },
        {
          'price' => {
            'type' => 'wysiwyg_field',
            'label' => 'wysi'
          }
        },
        {
          'quantity' => {
            'type' => 'number_field',
            'label' => 'wysi'
          }
        },
      ]
    end
  end

  def self.display_name
    'objeto'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
adminpanel-3.6.1 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.6.0 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.5.1 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.5.0 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.7 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.6 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.5 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.4 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.3 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.2 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.1 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.4.0 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.3.4 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.3.3 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.3.0 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.2.1 test/dummy/app/models/adminpanel/test_object.rb
adminpanel-3.2.0 test/dummy/app/models/adminpanel/test_object.rb