module ConsentFormsHelper
Public Instance Methods
Source
# File app/helpers/consent_forms_helper.rb, line 37 def backlink_path if params[:skip_to_confirm] wizard_path(Wicked::FINISH_STEP) else previous_wizard_path end end
Source
# File app/helpers/consent_forms_helper.rb, line 4 def health_answer_response(health_answer) if health_answer.response_yes? ["Yes", health_answer.notes].compact_blank.join(" – ") else "No" end end
Source
# File app/helpers/consent_forms_helper.rb, line 20 def health_question_backlink_path(consent_form, health_answer) follow_up_changes_start_page = session[:follow_up_changes_start_page]&.to_i question_number = params[:question_number]&.to_i if follow_up_changes_start_page && question_number == follow_up_changes_start_page wizard_path(Wicked::FINISH_STEP) elsif question_number&.positive? wizard_path( "health-question", question_number: previous_question_number(consent_form, health_answer) ) else previous_wizard_path end end
Source
# File app/helpers/consent_forms_helper.rb, line 12 def previous_question_number(consent_form, health_answer) current_index = consent_form.each_health_answer.find_index do |ha| ha.id == health_answer.id end consent_form.each_health_answer.to_a[current_index - 1].id end