blob: bfa7cbefa050fc135b25eff8f48930cfca08f6ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
class ComplianceControlsController < BreadcrumbController
include PolicyChecker
defaults resource_class: ComplianceControl
belongs_to :compliance_control_set
def create
create!(notice: t('notice.compliance_control.created'))
end
def update
path = compliance_control_set_compliance_control_path(parent, resource)
update!(notice: t('notice.compliance_control.updated')) { path }
end
def destroy
destroy!(notice: t('notice.compliance_control.destroyed'))
end
private
def compliance_control_params
params.require(:compliance_control).permit(:name, :code, :criticity, :comment, :control_attributes, :type, compliance_control_block_attributes: [:name])
end
end
|