From fd81429f39ac0da292e536c648e42936495823dc Mon Sep 17 00:00:00 2001 From: binarygit Date: Thu, 5 Jan 2023 13:53:02 +0545 Subject: [PATCH] Specify weight, height, width and depth as numeric field --- app/views/spree/admin/variants/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/variants/_form.html.haml b/app/views/spree/admin/variants/_form.html.haml index 1f492fc924..174cefcca6 100644 --- a/app/views/spree/admin/variants/_form.html.haml +++ b/app/views/spree/admin/variants/_form.html.haml @@ -66,12 +66,12 @@ .field = f.label 'weight', t(:weight)+' (kg)' - value = number_with_precision(@variant.weight, precision: 2) - = f.text_field 'weight', value: value, class: 'fullwidth' + = f.number_field 'weight', value: value, class: 'fullwidth', step: 0.01 - [:height, :width, :depth].each do |field| .field = f.label field, t(field) - value = number_with_precision(@variant.send(field), precision: 2) - = f.text_field field, value: value, class: 'fullwidth' + = f.number_field field, value: value, class: 'fullwidth', step: 0.01 .clear