We don't need to be fancy here

Redirect should be fine
This commit is contained in:
David Heinemeier Hansson
2025-10-30 14:42:48 +01:00
parent 217b860bb8
commit 5b70320a6b
+1 -9
View File
@@ -25,11 +25,7 @@ class CardsController < ApplicationController
@card.update! card_params
end
if @card.published?
render_card_replacement
else
redirect_to @card
end
redirect_to @card
end
def destroy
@@ -57,8 +53,4 @@ class CardsController < ApplicationController
def card_params
params.expect(card: [ :status, :title, :description, :image, tag_ids: [] ])
end
def render_card_replacement
render turbo_stream: turbo_stream.replace([ @card, :card_container ], partial: "cards/container", locals: { card: @card.reload })
end
end