Sha256: 47971b92775cfc8abdf43f540fce973505e0f77f3e4b7886017b77a06f579f79

Contents?: true

Size: 483 Bytes

Versions: 18

Compression:

Stored size: 483 Bytes

Contents

require_relative 'field'

module Avo
  module Fields
    class TrixField < Field
      def initialize(name, **args, &block)
        @defaults = {
          component: 'trix-field',
        }

        super(name, **args, &block)

        hide_on :index

        @always_show = args[:always_show].present? ? args[:always_show] : false
      end

      def hydrate_field(fields, model, resource, view)
        {
          always_show: @always_show
        }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
avo-0.4.10 lib/avo/app/fields/trix_field.rb
avo-0.4.9 lib/avo/app/fields/trix_field.rb
avo-0.4.8 lib/avo/app/fields/trix_field.rb
avo-0.4.7 lib/avo/app/fields/trix_field.rb
avo-0.4.6 lib/avo/app/fields/trix_field.rb
avo-0.4.5 lib/avo/app/fields/trix_field.rb
avo-0.4.4 lib/avo/app/fields/trix_field.rb
avo-0.4.3 lib/avo/app/fields/trix_field.rb
avo-0.4.2 lib/avo/app/fields/trix_field.rb
avo-0.4.1 lib/avo/app/fields/trix_field.rb
avo-0.3.2 lib/avo/app/fields/trix_field.rb
avo-0.3.1 lib/avo/app/fields/trix_field.rb
avo-0.2.5 lib/avo/app/fields/trix_field.rb
avo-0.2.4 lib/avo/app/fields/trix_field.rb
avo-0.2.3 lib/avo/app/fields/trix_field.rb
avo-0.2.2 lib/avo/app/fields/trix_field.rb
avo-0.2.1 lib/avo/app/fields/trix_field.rb
avo-0.2.0 lib/avo/app/fields/trix_field.rb