Skip to content

Commit

Permalink
use render edit instead of redirect_to
Browse files Browse the repository at this point in the history
with redirect_to, the validation errors will be lost at the rendering time.
  • Loading branch information
abdellani committed Nov 27, 2023
1 parent f5a51ec commit 267f34b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/spree/admin/variants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 267f34b

Please sign in to comment.