Class: Trestle::Form::Fields::DateSelect
- Inherits:
-
Trestle::Form::Field
- Object
- Trestle::Form::Field
- Trestle::Form::Fields::DateSelect
- Defined in:
- lib/trestle/form/fields/date_select.rb
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
Attributes inherited from Trestle::Form::Field
#block, #builder, #name, #options, #template
Instance Method Summary collapse
- #default_html_options ⇒ Object
- #field ⇒ Object
-
#initialize(builder, template, name, options = {}, html_options = {}, &block) ⇒ DateSelect
constructor
A new instance of DateSelect.
Methods inherited from Trestle::Form::Field
#defaults, #disabled?, #errors, #form_group, #normalize_options!, #readonly?, #render
Constructor Details
#initialize(builder, template, name, options = {}, html_options = {}, &block) ⇒ DateSelect
Returns a new instance of DateSelect.
7 8 9 10 11 |
# File 'lib/trestle/form/fields/date_select.rb', line 7 def initialize(builder, template, name, ={}, ={}, &block) super(builder, template, name, , &block) @html_options = .merge() end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
5 6 7 |
# File 'lib/trestle/form/fields/date_select.rb', line 5 def @html_options end |
Instance Method Details
#default_html_options ⇒ Object
19 20 21 |
# File 'lib/trestle/form/fields/date_select.rb', line 19 def Trestle::Options.new(class: ["form-select"], disabled: readonly?, data: { controller: "select" }) end |
#field ⇒ Object
13 14 15 16 17 |
# File 'lib/trestle/form/fields/date_select.rb', line 13 def field tag.div(class: "date-select") do builder.raw_date_select(name, , , &block) end end |