Sha256: 706669bdc1e98c05423f1ca4f991397aa38c31f4f32e2b9cf21650ba6c1f2f1a

Contents?: true

Size: 569 Bytes

Versions: 29

Compression:

Stored size: 569 Bytes

Contents

module Avo
  module Fields
    class MarkdownField < BaseField
      def initialize(name, **args, &block)
        @defaults = {
          partial_name: "markdown-field"
        }

        super(name, **args, &block)

        hide_on :index

        @always_show = args[:always_show].present? ? args[:always_show] : false
        @height = args[:height].present? ? args[:height].to_s : "auto"
      end

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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
avo-1.0.2 lib/avo/fields/markdown_field.rb
avo-1.0.1 lib/avo/fields/markdown_field.rb
avo-1.0.0 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta15 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta14 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta13 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta12 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta11 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta10 lib/avo/fields/markdown_field.rb