<% if products.any? %>
  <% form_tag admin_product_groups_path do %>
    <%= hidden_field_tag 'product_group[product_scopes_attributes][][name]', 'with_ids' %>
    <%= hidden_field_tag 'product_group[product_scopes_attributes][][arguments][]', products.map(&:id).join(',') %>
    <fieldset data-hook="create_group">
      <legend><%= t(:create_product_group_from_products) %></legend>
      <%= label_tag nil, t(:name) %>
      <%= text_field_tag 'product_group[name]', t(:new_group) %>
      <%= submit_tag t(:create) %>
    </fieldset>
  <% end %>
<% end %>
