Remplace collection_select by select and fill the selected item

+ add tom-select controller
This commit is contained in:
Jean-Baptiste Bellet
2022-05-12 14:40:58 +02:00
parent e058cd3e06
commit 68f8413cda

View File

@@ -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