Sha256: 7e73a002564cbdca378f1911e0a668d86d8cb54cf43c63ad61478d386519608f
Contents?: true
Size: 623 Bytes
Versions: 145
Compression:
Stored size: 623 Bytes
Contents
require "securerandom" module Avo module Fields class HeadingField < BaseField attr_reader :as_html def initialize(id, **args, &block) args[:updatable] = false @label = args[:label] || id.to_s.humanize super(id, **args, &block) # this field is not used to update anything @for_presentation_only = true hide_on :index @as_html = args[:as_html].presence || false end def id "heading_#{name.to_s.parameterize.underscore}" end def value block.present? ? execute_block : @label end end end end
Version data entries
145 entries across 145 versions & 1 rubygems