Sha256: df281771ddee5b7e22f1ed22378919f16d8aa4faefb96da2210635c532dd79d8

Contents?: true

Size: 570 Bytes

Versions: 5

Compression:

Stored size: 570 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

5 entries across 5 versions & 1 rubygems

Version Path
avo-0.5.0.beta9 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta8 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta7 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta6 lib/avo/fields/markdown_field.rb
avo-0.5.0.beta5 lib/avo/fields/markdown_field.rb