Initialize on_demand checkbox value

This commit is contained in:
Jean-Baptiste Bellet
2022-05-24 16:11:05 +02:00
parent 70baccd76c
commit 454e4a4100
2 changed files with 2 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ module Spree
else
# Re-fill the form with deleted params on product
@on_hand = request.params[:product][:on_hand]
@on_demand = request.params[:product][:on_demand]
render :new
end
end

View File

@@ -83,7 +83,7 @@
= f.field_container :on_demand do
= f.label :on_demand, t(".on_demand")
%br/
= f.check_box :on_demand
= f.check_box :on_demand, value: '1', checked: @on_demand == '1'
= f.error_message_on :on_demand
.sixteen.columns.alpha