Allow to destroy SDG local targets
This commit is contained in:
@@ -24,7 +24,7 @@ class SDGManagement::LocalTargets::IndexComponent < ApplicationComponent
|
||||
def actions(local_target)
|
||||
render Admin::TableActionsComponent.new(
|
||||
local_target,
|
||||
actions: [:edit],
|
||||
edit_path: edit_sdg_management_local_target_path(local_target))
|
||||
edit_path: edit_sdg_management_local_target_path(local_target),
|
||||
destroy_path: sdg_management_local_target_path(local_target))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,6 +35,12 @@ class SDGManagement::LocalTargetsController < SDGManagement::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@local_target = LocalTarget.find(params[:id])
|
||||
@local_target.destroy!
|
||||
redirect_to sdg_management_local_targets_path, notice: t("sdg_management.local_targets.destroy.notice")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def local_target_params
|
||||
|
||||
Reference in New Issue
Block a user