From b6bc4c66a2a2ad08f3d803f307dfab1432b6ae61 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 13 Oct 2022 13:53:03 +0200 Subject: [PATCH] Specify the current value of country --- app/views/admin/enterprises/form/_business_address.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/form/_business_address.html.haml b/app/views/admin/enterprises/form/_business_address.html.haml index 44e1b93353..b36c44f5cb 100644 --- a/app/views/admin/enterprises/form/_business_address.html.haml +++ b/app/views/admin/enterprises/form/_business_address.html.haml @@ -31,7 +31,7 @@ = bf.label :state_id, t(:state) %div{"data-controller": "dependant-select", "data-dependant-select-options-value": countries_with_states } .four.columns - = bf.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange", class: "primary" } + = bf.select :country_id, options_for_select(available_countries.map { |c| [c.name, c.id] }, @enterprise.business_address.country_id), {}, { "data-controller": "tom-select", "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange", class: "primary" } .four.columns.omega = bf.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependant-select-target": "select", class: "primary" }