Class: Alchemy::Ingredients::TextEditor
- Inherits:
-
BaseEditor
- Object
- ViewComponent::Base
- BaseEditor
- Alchemy::Ingredients::TextEditor
- Defined in:
- app/components/alchemy/ingredients/text_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 31 32 33 34 35 36 37 38 |
# File 'app/components/alchemy/ingredients/text_editor.rb', line 6 def input_field tag.div(class: "input-field") do concat text_field_tag(form_field_name, value, class: settings[:linkable] ? "text_with_icon" : "", id: form_field_id, minlength: length_validation&.fetch(:minimum, nil), maxlength: length_validation&.fetch(:maximum, nil), required: presence_validation?, pattern: format_validation, readonly: !editable?, type: settings[:input_type] || "text") if settings[:anchor] concat render( "alchemy/ingredients/shared/anchor", ingredient: ) end if settings[:linkable] concat hidden_field_tag(form_field_name(:link), ingredient.link, "data-link-value": true, id: nil) concat hidden_field_tag(form_field_name(:link_title), ingredient.link_title, "data-link-title": true, id: nil) concat hidden_field_tag(form_field_name(:link_class_name), ingredient.link_class_name, "data-link-class": true, id: nil) concat hidden_field_tag(form_field_name(:link_target), ingredient.link_target, "data-link-target": true, id: nil) concat render( "alchemy/ingredients/shared/link_tools", ingredient:, wrapper_class: "ingredient_link_buttons" ) end end end |