aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGuillaume2017-09-18 11:11:36 +0200
committerGuillaume2017-09-18 11:11:36 +0200
commit06ad1bb051cabb4575306f7397287ea77d70e109 (patch)
tree83c794c3120fd8b7413b749cba2a5553dff756bf /app/controllers
parent1e58dfdbfbecccda78e2fe3854b2ba04a72bd511 (diff)
parent60ad22fa8db3c1f2cbfe532a73deca4b97232a25 (diff)
downloadchouette-core-06ad1bb051cabb4575306f7397287ea77d70e109.tar.bz2
Merge branch '4467_compliance_control_crud' into 4466-compliance_control_sets
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