Class: Effective::CpdAuditReviewsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Effective::CpdAuditReviewsController
- Includes:
- WizardController
- Defined in:
- app/controllers/effective/cpd_audit_reviews_controller.rb
Instance Method Summary collapse
- #permitted_params ⇒ Object
-
#render_step(the_step, options = {}, params = {}) ⇒ Object
Reuse the same view for all cpd_audit_level_section steps github.com/zombocom/wicked/blob/v1.3.4/lib/wicked/controller/concerns/render_redirect.rb#L32.
Instance Method Details
#permitted_params ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/effective/cpd_audit_reviews_controller.rb', line 23 def permitted_params case step when :start params.require(:effective_cpd_audit_review).permit(:current_step, :comments) when :information params.require(:effective_cpd_audit_review).permit(:current_step, :comments) when :instructions params.require(:effective_cpd_audit_review).permit(:current_step, :comments) when :conflict params.require(:effective_cpd_audit_review) .permit(:current_step, :comments, :conflict_of_interest, :conflict_of_interest_reason) when :statements params.require(:effective_cpd_audit_review).permit(:current_step, :comments) when :questionnaire params.require(:effective_cpd_audit_review).permit(:current_step, :comments) when :recommendation params.require(:effective_cpd_audit_review).permit(:current_step, :comments, :recommendation) when :submit params.require(:effective_cpd_audit_review).permit(:current_step) when :complete raise('unexpected post to complete') else if step.to_s.start_with?('statement') params.require(:effective_cpd_audit_review).permit(:current_step, :comments, cpd_audit_review_items_attributes: [:id, :item_id, :item_type, :recommendation, :comments] ) elsif step.to_s.start_with?('section') params.require(:effective_cpd_audit_review).permit(:current_step, :comments, cpd_audit_review_items_attributes: [:id, :item_id, :item_type, :recommendation, :comments] ) else raise('unexpected step') end end end |
#render_step(the_step, options = {}, params = {}) ⇒ Object
Reuse the same view for all cpd_audit_level_section steps github.com/zombocom/wicked/blob/v1.3.4/lib/wicked/controller/concerns/render_redirect.rb#L32
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/effective/cpd_audit_reviews_controller.rb', line 13 def render_step(the_step, = {}, params = {}) if resource.dynamic_wizard_statement_steps.keys.include?(the_step) render('cpd_statement', ) elsif resource.dynamic_wizard_questionnaire_steps.keys.include?(the_step) render('cpd_audit_level_section', ) else super end end |