aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/compliance_controls_controller.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb
new file mode 100644
index 000000000..d198f2cdb
--- /dev/null
+++ b/app/controllers/compliance_controls_controller.rb
@@ -0,0 +1,22 @@
+class ComplianceControlsController < BreadcrumbController
+ 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)
+ end
+end