Remove anemic and indirect method that explained nothing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user