File tree 1 file changed +4
-4
lines changed
promotions/lib/controllers/backend/solidus_promotions/admin
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def new
14
14
def create
15
15
@benefit = @benefit_type . new ( benefit_params )
16
16
@benefit . promotion = @promotion
17
- if @benefit . save ( validate : false )
17
+ if @benefit . save
18
18
flash [ :success ] =
19
19
t ( "spree.successfully_created" , resource : SolidusPromotions ::Benefit . model_name . human )
20
20
redirect_to location_after_save , format : :html
21
21
else
22
- render :new , layout : false
22
+ render :new , layout : false , status : :unprocessable_entity
23
23
end
24
24
end
25
25
@@ -28,7 +28,7 @@ def edit
28
28
if params . dig ( :benefit , :calculator_type )
29
29
@benefit . calculator_type = params [ :benefit ] [ :calculator_type ]
30
30
end
31
- render layout : false
31
+ render layout : false , status : :unprocessable_entity
32
32
end
33
33
34
34
def update
@@ -39,7 +39,7 @@ def update
39
39
t ( "spree.successfully_updated" , resource : SolidusPromotions ::Benefit . model_name . human )
40
40
redirect_to location_after_save , format : :html
41
41
else
42
- render :edit
42
+ render :edit , status : :unprocessable_entity
43
43
end
44
44
end
45
45
You can’t perform that action at this time.
0 commit comments