From 9f6c7a5372d960eea49f5428975d7a92f6f91d33 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Jan 2018 15:09:02 +0100 Subject: ComplianceControlDecorator: Convert to new action links interface * Decorate the `ComplianceControl` so we can show the action links from the decorator in the header. * Add a `decorates` to get `object_class` to work inside the decorator. * Define `AF83::Decorator.define_instance_class_method` in order to enable the `@compliance_control.class.METHOD` calls in the view to work. Thanks very much to Johan for figuring out a way to do that. Refs #5586 --- app/controllers/compliance_controls_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers/compliance_controls_controller.rb') diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb index dfbecaa71..73dc18f59 100644 --- a/app/controllers/compliance_controls_controller.rb +++ b/app/controllers/compliance_controls_controller.rb @@ -8,6 +8,12 @@ class ComplianceControlsController < ChouetteController @sti_subclasses = ComplianceControl.subclasses end + def show + show! do + @compliance_control = @compliance_control.decorate + end + end + def new if params[:sti_class].blank? flash[:notice] = I18n.t("compliance_controls.errors.mandatory_control_type") -- cgit v1.2.3