From 2d3d4051fe5b1be21ea584e7765b5853d83ed90d Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sat, 30 Nov 2024 11:45:35 -0800 Subject: [PATCH] Oops, return HTTP Bad Request when item editing fails Just a subtle thing, but Turbo can be picky about return types, and won't reload the page with the errors in it if the status is 200. --- app/controllers/items_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index ee7454b20..43384d85d 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -124,7 +124,7 @@ class ItemsController < ApplicationController flash[:notice] = "\"#{@item.name}\" successfully saved!" redirect_to @item else - render action: "edit", layout: "application" + render action: "edit", layout: "application", status: :bad_request end end