Initialize with submitted value on_hand

This commit is contained in:
Jean-Baptiste Bellet
2022-05-12 14:41:41 +02:00
parent be0065ad1a
commit c78e734dee
2 changed files with 3 additions and 1 deletions

View File

@@ -36,6 +36,8 @@ module Spree
redirect_to spree.admin_products_path
end
else
# Re-fill the form with deleted params on product
@on_hand = request.params[:product][:on_hand]
render :new
end
end

View File

@@ -77,7 +77,7 @@
= f.field_container :on_hand do
= f.label :on_hand, t(".on_hand")
%br/
= f.text_field :on_hand, class: 'fullwidth'
= f.text_field :on_hand, class: 'fullwidth', value: @on_hand
= f.error_message_on :on_hand
.three.columns.omega
= f.field_container :on_demand do