Inline anemic method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user