Sha256: 347556ec59dccba9d82890851ba5c41794e6665d24655273e02f113c759672ca

Contents?: true

Size: 536 Bytes

Versions: 18

Compression:

Stored size: 536 Bytes

Contents

module Avo
  module Fields
    class TextField < Field
      def initialize(name, **args, &block)
        @defaults = {
          sortable: true,
          component: 'text-field',
          computable: true,
        }.merge(@defaults || {})

        super(name, **args, &block)

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

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

Version data entries

18 entries across 18 versions & 1 rubygems

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