Module: StimulusPlumbers::Form::Fields::Inputs::Datetime
- Included in:
- Builder
- Defined in:
- lib/stimulus_plumbers/form/fields/inputs/datetime.rb
Instance Method Summary collapse
Instance Method Details
#date_field(attribute, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/stimulus_plumbers/form/fields/inputs/datetime.rb', line 8 def date_field(attribute, = {}) html_native = .delete(:html_native) { false } Field.new(@template, **).render( object, attribute, input_id: field_id(attribute) ) do |html_opts, opts, error| if html_native = (opts, html_opts, field_theme(:form_input, error: error)) super(attribute, ) else render_date_combobox(attribute, html_opts, error) end end end |
#time_field(attribute, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/stimulus_plumbers/form/fields/inputs/datetime.rb', line 24 def time_field(attribute, = {}) html_native = .delete(:html_native) { false } format = .delete(:format) { :h12 } step = .delete(:step) { 1 } Field.new(@template, **).render( object, attribute, input_id: field_id(attribute) ) do |html_opts, opts, error| if html_native = (opts, html_opts, field_theme(:form_input, error: error)) super(attribute, ) else render_time_combobox(attribute, html_opts, error, format: format, step: step) end end end |