class Trestle::Form::Fields::DatetimeSelect

Attributes

html_options[R]

Public Class Methods

new(builder, template, name, options={}, html_options={}, &block) click to toggle source
Calls superclass method Trestle::Form::Field::new
# File lib/trestle/form/fields/datetime_select.rb, line 7
def initialize(builder, template, name, options={}, html_options={}, &block)
  super(builder, template, name, options, &block)

  @html_options = default_html_options.merge(html_options)
end

Public Instance Methods

default_html_options() click to toggle source
# File lib/trestle/form/fields/datetime_select.rb, line 19
def default_html_options
  Trestle::Options.new(class: ["form-control"], disabled: readonly?, data: { enable_select2: true })
end
field() click to toggle source
# File lib/trestle/form/fields/datetime_select.rb, line 13
def field
  content_tag(:div, class: "datetime-select") do
    builder.raw_datetime_select(name, options, html_options, &block)
  end
end