mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
number_to_currency can be nil: use a safe operator
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
= f.text_field :sku, class: 'fullwidth'
|
||||
.field
|
||||
= f.label :price, t('.price')
|
||||
= f.text_field :price, class: 'fullwidth', "ng-model" => "variant.price", "ng-init" => "variant.price = '#{number_to_currency(@variant.price, unit: '').strip}'"
|
||||
= f.text_field :price, class: 'fullwidth', "ng-model" => "variant.price", "ng-init" => "variant.price = '#{number_to_currency(@variant.price, unit: '')&.strip}'"
|
||||
.field
|
||||
= hidden_field_tag 'product_variant_unit', @product.variant_unit
|
||||
= hidden_field_tag 'product_variant_unit_name', @product.variant_unit_name
|
||||
|
||||
Reference in New Issue
Block a user