Inline anemic method

This commit is contained in:
David Heinemeier Hansson
2025-04-12 13:48:03 +02:00
parent 9b89562755
commit 19c537af64
+1 -5
View File
@@ -26,7 +26,7 @@ class CardsController < ApplicationController
def destroy
@card.destroy!
redirect_to cards_path(collection_ids: [ @card.collection ]), notice: deleted_notice
redirect_to cards_path(collection_ids: [ @card.collection ]), notice: ("Card deleted" unless @card.creating?)
end
def update
@@ -50,8 +50,4 @@ class CardsController < ApplicationController
def card_params
params.expect(card: [ :status, :title, :color, :due_on, :image, :draft_comment, tag_ids: [] ])
end
def deleted_notice
"Card deleted" unless @card.creating?
end
end