Sha256: 7d8ad928dfb05300f53095b79b50389ac8ee5f464b6622dd85a2c787a9a9042d

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

<%= content_tag :div,
  class: node_editor.css_classes,
  data: node_editor.data_attributes do %>
  <%= element_form.fields_for(:ingredients, node_editor.ingredient) do |f| %>
    <%= ingredient_label(node_editor, :node_id) %>
    <%= f.text_field :node_id,
      value: node_editor.node&.id,
      class: 'alchemy_selectbox full_width' %>
  <% end %>
<% end %>

<script>
  <% query_params = node_editor.settings.fetch(:query_params, {}).merge({
    include: :ancestors
  }) %>
  $('#<%= node_editor.form_field_id(:node_id) %>').alchemyNodeSelect({
    placeholder: "<%= Alchemy.t(:search_node) %>",
    url: "<%= alchemy.api_nodes_path %>",
    query_params: <%== query_params.to_json %>,
    <% if node_editor.node %>
    <% serialized_node = ActiveModelSerializers::SerializableResource.new(node_editor.node, include: :ancestors) %>
    initialSelection: <%== serialized_node.to_json %>
    <% end %>
  })
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-6.0.0.b2 app/views/alchemy/ingredients/_node_editor.html.erb
alchemy_cms-6.0.0.b1 app/views/alchemy/ingredients/_node_editor.html.erb