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.
This commit is contained in:
parent
3cd02baa09
commit
2d3d4051fe
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue