Browse Source

fixed checks answers labels

pull/49/head
magicmilo 4 years ago
parent
commit
fcbbc13d3b
  1. 8
      app/controllers/case_logs_controller.rb
  2. 2
      app/views/form/_check_answers_table.html.erb

8
app/controllers/case_logs_controller.rb

@ -130,14 +130,14 @@ private
end
def get_next_page_path(form, previous_page, responses_for_page = {})
# binding.pry
questions_for_page = form.questions_for_page(previous_page)
questions_for_page.each do |question, content|
if content.key?("conditional_route_to")
content["conditional_route_to"].each do |route, answer|
# binding.pry
if answer.include?(responses_for_page[question])
return "case_log_#{route}_path"
if !responses_for_page[question].nil?
if answer.include?(responses_for_page[question])
return "case_log_#{route}_path"
end
end
end
end

2
app/views/form/_check_answers_table.html.erb

@ -1,7 +1,7 @@
<dl class="govuk-summary-list govuk-!-margin-bottom-9">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= question_info["check_answer_label"].to_s %>
<%= question_info["check_answer_label"].to_s != "" ? question_info["check_answer_label"].to_s : question_info["header"].to_s%>
<dt>
<dd class="govuk-summary-list__value">
<%= @case_log[question_title] %>

Loading…
Cancel
Save