Sha256: 0677991b22f8a9f38cd571d9f95ac5d15b34f24ba87afd1cfdee9f23027f7e65
Contents?: true
Size: 771 Bytes
Versions: 7
Compression:
Stored size: 771 Bytes
Contents
module Trestle class Form module Fields class DateSelect < Field attr_reader :html_options def initialize(builder, template, name, options={}, html_options={}, &block) super(builder, template, name, options, &block) @html_options = default_html_options.merge(html_options) end def field content_tag(:div, class: "date-select") do builder.raw_date_select(name, options, html_options, &block) end end def default_html_options Trestle::Options.new(class: ["form-control"], disabled: readonly?, data: { enable_select2: true }) end end end end end Trestle::Form::Builder.register(:date_select, Trestle::Form::Fields::DateSelect)
Version data entries
7 entries across 7 versions & 1 rubygems