Class: Alchemy::Ingredients::DatetimeEditor

Inherits:
BaseEditor
  • Object
show all
Defined in:
app/components/alchemy/ingredients/datetime_editor.rb

Instance Attribute Summary

Attributes inherited from BaseEditor

#html_options, #ingredient

Instance Method Summary collapse

Methods inherited from BaseEditor

#call, #form_field_id, #form_field_name, #initialize

Constructor Details

This class inherits a constructor from Alchemy::Ingredients::BaseEditor

Instance Method Details

#input_fieldObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/components/alchemy/ingredients/datetime_editor.rb', line 8

def input_field
  tag.div(class: "input-field") do
    concat alchemy_datepicker(
      ingredient, :value, {
        name: form_field_name,
        id: form_field_id,
        value: value,
        type: settings[:input_type],
        disabled: !editable?
      }
    )
    concat tag.label(
      render_icon(:calendar),
      for: form_field_id,
      class: "ingredient-date--label"
    )
  end
end