module Effective class CpdAuditsController < ApplicationController before_action(:authenticate_user!) if defined?(Devise) include Effective::WizardController resource_scope -> { EffectiveCpd.CpdAudit.deep.where(user: current_user) } submit :resubmit, 'Resubmit Audit' # Reuse the same view for all cpd_audit_level_section steps # https://github.com/zombocom/wicked/blob/v1.3.4/lib/wicked/controller/concerns/render_redirect.rb#L32 def render_step(the_step, options = {}, params = {}) return super unless resource.dynamic_wizard_steps.keys.include?(the_step) render('cpd_audit_level_section', options) end end end