Class: Alchemy::Ingredients::ColorEditor
- Inherits:
-
BaseEditor
- Object
- ViewComponent::Base
- BaseEditor
- Alchemy::Ingredients::ColorEditor
- Defined in:
- app/components/alchemy/ingredients/color_editor.rb
Instance Attribute Summary
Attributes inherited from BaseEditor
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_field ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/alchemy/ingredients/color_editor.rb', line 6 def input_field content_tag("alchemy-color-select") do if colors.none? concat text_field_tag( form_field_name, value, disabled: !editable? ) concat color_field_tag(nil, value, disabled: disabled?) else concat select_tag( form_field_name, .join.html_safe, disabled: !editable? ) concat color_field_tag(form_field_name, value, disabled: disabled?) end end end |