Sha256: c5b0033e708955e6305856ff31ce12703506c12250456774b5d613695d059002
Contents?: true
Size: 750 Bytes
Versions: 9
Compression:
Stored size: 750 Bytes
Contents
module Trestle class Form module Fields class TimeSelect < 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: "time-select") do builder.raw_time_select(name, options, html_options, &block) end end def default_html_options Trestle::Options.new(class: ["form-control"], data: { enable_select2: true }) end end end end end Trestle::Form::Builder.register(:time_select, Trestle::Form::Fields::TimeSelect)
Version data entries
9 entries across 9 versions & 1 rubygems