Class: Alchemy::Ingredients::NodeEditor

Inherits:
BaseEditor
  • Object
show all
Defined in:
app/components/alchemy/ingredients/node_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
# File 'app/components/alchemy/ingredients/node_editor.rb', line 8

def input_field
  render Alchemy::Admin::NodeSelect.new(
    node,
    url: alchemy.api_nodes_path(language_id: page&.language_id, include: :ancestors),
    query_params: settings.fetch(:query_params, {})
  ) do
    text_field_tag form_field_name(:node_id),
      node&.id,
      id: form_field_id(:node_id),
      class: "alchemy_selectbox full_width",
      disabled: !editable?
  end
end