Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Use form object in the address form instead of the provided address (#12257)

Damian Kaczmarczyk412baa75b361
diff --git a/core/app/views/spree/addresses/_form.html.erb b/core/app/views/spree/addresses/_form.html.erb
index f0a66c54f6..f1c0438c29 100644
--- a/core/app/views/spree/addresses/_form.html.erb
+++ b/core/app/views/spree/addresses/_form.html.erb
@@ -11,7 +11,7 @@
<div class="form-group mb-0">
<div id="<%= "#{address_id}country-selection" %>">
<%= address_form.label(Spree.t(:country), Spree.t(:country), class: 'block text-xs text-neutral-600 mb-1') %>
- <%= address_form.select :country_id, options_for_select(available_countries.map { |c| [c.name, c.id, data: { iso: c.iso }] }, address.country_id || current_store.default_country_id),
+ <%= address_form.select :country_id, options_for_select(available_countries.map { |c| [c.name, c.id, data: { iso: c.iso }] }, address_form.object.country_id || current_store.default_country_id),
{ },
{ class: 'w-full select-input mb-4',
data: {