From 267f34b134911a7713a1e9ba8747ae39190fceee Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Mon, 27 Nov 2023 15:49:24 +0100 Subject: [PATCH] use render edit instead of redirect_to with redirect_to, the validation errors will be lost at the rendering time. --- app/controllers/spree/admin/variants_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/spree/admin/variants_controller.rb b/app/controllers/spree/admin/variants_controller.rb index 6033db7afeda..47505f7b1dba 100644 --- a/app/controllers/spree/admin/variants_controller.rb +++ b/app/controllers/spree/admin/variants_controller.rb @@ -50,9 +50,8 @@ def update flash[:success] = flash_message_for(@object, :successfully_updated) redirect_to spree.admin_product_variants_url(params[:product_id], @url_filters) else - redirect_to spree.edit_admin_product_variant_url(params[:product_id], - @object, - @url_filters) + load_data + render :edit end end