From 68f8413cda695c12a12f7fdf95e92b67f90cfec2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 12 May 2022 14:40:58 +0200 Subject: [PATCH] Remplace `collection_select` by `select` and fill the selected item + add tom-select controller --- app/views/spree/admin/products/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/admin/products/new.html.haml b/app/views/spree/admin/products/new.html.haml index 4e0ea2b7c5..13c6600950 100644 --- a/app/views/spree/admin/products/new.html.haml +++ b/app/views/spree/admin/products/new.html.haml @@ -11,7 +11,7 @@ = f.field_container :supplier do = f.label :supplier_id, t(".supplier") %span.required * - = f.collection_select(:supplier_id, @producers, :id, :name, {:include_blank => true, :selected => select_only_item(@producers)}, {:class => "select2 fullwidth"}) + = f.select :supplier_id, options_from_collection_for_select(@producers, :id, :name, @product.supplier_id), {}, { "data-controller": "tom-select", class: "primary" } = f.error_message_on :supplier .eight.columns.omega = f.field_container :name do