Class: Alchemy::Ingredients::SelectEditor
- Inherits:
-
BaseEditor
- Object
- ViewComponent::Base
- BaseEditor
- Alchemy::Ingredients::SelectEditor
- Defined in:
- app/components/alchemy/ingredients/select_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 25 26 27 28 29 30 |
# File 'app/components/alchemy/ingredients/select_editor.rb', line 6 def input_field if select_values.nil? warning(":select_values is nil", <<-MSG.strip_heredoc <strong>No select values given.</strong> <br>Please provide <code>select_values</code> on the ingredient definition <code>settings</code> in <code>elements.yml</code>. MSG ) else = if select_values.is_a?(Hash) (select_values, value) else (select_values, value) end select_tag form_field_name, , { id: form_field_id, class: ["ingredient-editor-select"], is: "alchemy-select", multiple: settings[:multiple], disabled: !editable? } end end |