diff --git a/backend/app/assets/javascripts/spree/backend/format_money.js.erb b/backend/app/assets/javascripts/spree/backend/format_money.js similarity index 60% rename from backend/app/assets/javascripts/spree/backend/format_money.js.erb rename to backend/app/assets/javascripts/spree/backend/format_money.js index 640e74fb232..6f327937053 100644 --- a/backend/app/assets/javascripts/spree/backend/format_money.js.erb +++ b/backend/app/assets/javascripts/spree/backend/format_money.js @@ -1,22 +1,6 @@ //= require spree/backend/translation //= require solidus_admin/accounting -Spree.currencyInfo = <%= -Money::Currency.all.map { |c| - format = - if c.symbol == "" || c.symbol_first - "%s%v" - else - "%v %s" - end - [c.id.to_s.upcase, [ - c.symbol || "¤", - c.exponent, - format - ]] -}.to_h.to_json -%>; - Spree.formatMoney = function(amount, currency) { var currencyInfo = Spree.currencyInfo[currency]; diff --git a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb index 9a36b8e2cc3..e973981723c 100644 --- a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb +++ b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb @@ -21,7 +21,23 @@ currency_delimiter: I18n.t('number.currency.format.delimiter'), activerecord: I18n.t('activerecord') }).to_json -%> +%>; + + Spree.currencyInfo = <%== + Money::Currency.all.map { |c| + format = + if c.symbol == "" || c.symbol_first + "%s%v" + else + "%v %s" + end + [c.id.to_s.upcase, [ + c.symbol || "¤", + c.exponent, + format + ]] + }.to_h.to_json +%>;