Class: Alchemy::Ingredients::LinkEditor

Inherits:
BaseEditor
  • Object
show all
Defined in:
app/components/alchemy/ingredients/link_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



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

def input_field
  tag.div(class: "input-field") do
    concat text_field_tag(form_field_name,
      value,
      class: "thin_border text_with_icon readonly",
      id: form_field_id,
      "data-link-value": true,
      minlength: length_validation&.fetch(:minimum, nil),
      maxlength: length_validation&.fetch(:maximum, nil),
      required: presence_validation?,
      pattern: format_validation,
      readonly: true,
      tabindex: -1)
    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