Remove anemic and indirect method that explained nothing

This commit is contained in:
David Heinemeier Hansson
2025-04-13 20:25:59 +02:00
parent e2a931b657
commit a5df54015e
+6 -9
View File
@@ -8,7 +8,12 @@ class FiltersController < ApplicationController
def destroy
@filter.destroy!
redirect_after_destroy
if request.referer == root_url
redirect_to root_path
else
redirect_to cards_path(@filter.as_params)
end
end
private
@@ -19,12 +24,4 @@ class FiltersController < ApplicationController
def filter_params
params.permit(*Filter::PERMITTED_PARAMS).compact_blank
end
def redirect_after_destroy
if request.referer == root_url
redirect_to root_path
else
redirect_to cards_path(@filter.as_params)
end
end
end