Skip to content

Commit

Permalink
redirect product update
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Nov 19, 2024
1 parent a2488bb commit fe27fe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create
end

if @product.save
redirect_to @product, notice: 'Product was successfully created.'
redirect_to user_product_path(current_user.username, @product), notice: 'Product was successfully created.'
else
render "create"
# render :new, status: 422
Expand All @@ -68,7 +68,7 @@ def update
end

if @product.save
redirect_to user_product_path(current_user, @product), notice: 'Product was successfully updated.'
redirect_to user_product_path(current_user.username, @product), notice: 'Product was successfully updated.'
else
Rails.logger.error("AAA #{@product.errors.full_messages}")
# render :edit, status: 422
Expand Down

0 comments on commit fe27fe7

Please sign in to comment.