mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
Prefer family currency preference than default currenty (#755)
This commit is contained in:
parent
45ae4a9737
commit
1bbfdee463
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ class ApplicationFormBuilder < ActionView::Helpers::FormBuilder
|
||||||
|
|
||||||
readonly_currency = options[:readonly_currency] || false
|
readonly_currency = options[:readonly_currency] || false
|
||||||
|
|
||||||
currency = money&.currency || Money.default_currency
|
currency = money&.currency || Money::Currency.new(Current.family.currency) || Money.default_currency
|
||||||
default_options = {
|
default_options = {
|
||||||
class: "form-field__input",
|
class: "form-field__input",
|
||||||
value: money&.amount,
|
value: money&.amount,
|
||||||
|
@ -45,7 +45,7 @@ class ApplicationFormBuilder < ActionView::Helpers::FormBuilder
|
||||||
merged_options = default_options.merge(options)
|
merged_options = default_options.merge(options)
|
||||||
|
|
||||||
grouped_options = currency_options_for_select
|
grouped_options = currency_options_for_select
|
||||||
selected_currency = money&.currency&.iso_code
|
selected_currency = money&.currency&.iso_code || currency.iso_code
|
||||||
|
|
||||||
@template.form_field_tag data: { controller: "money-field" } do
|
@template.form_field_tag data: { controller: "money-field" } do
|
||||||
(label(method, *label_args(options)).to_s if options[:label]) +
|
(label(method, *label_args(options)).to_s if options[:label]) +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue