Browse Source

Method args

pull/273/head
baarkerlounger 3 years ago committed by MadeTech Dushan
parent
commit
6a4c5a77a4
  1. 2
      app/helpers/check_answers_helper.rb
  2. 4
      app/views/form/_check_answers_table.html.erb

2
app/helpers/check_answers_helper.rb

@ -12,7 +12,7 @@ module CheckAnswersHelper
end end
def get_answer_label(question, case_log) def get_answer_label(question, case_log)
if question.answer_label.present? if question.answer_label(case_log).present?
question.answer_label(case_log) question.answer_label(case_log)
else else
"<span class=\"app-!-colour-muted\">You didn’t answer this question</span>".html_safe "<span class=\"app-!-colour-muted\">You didn’t answer this question</span>".html_safe

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

@ -2,7 +2,7 @@
<% unless question.id == "incfreq" %> <% unless question.id == "incfreq" %>
<div class="govuk-summary-list__row"> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key"> <dt class="govuk-summary-list__key">
<%= question.check_answer_label.to_s.present? ? question.check_answer_label.to_s : question.header.to_s %> <%= question.check_answer_label.to_s.present? ? question.check_answer_label.to_s : question.header.to_s %>
</dt> </dt>
<dd class="govuk-summary-list__value"> <dd class="govuk-summary-list__value">
<%= get_answer_label(question, @case_log) %><br/> <%= get_answer_label(question, @case_log) %><br/>
@ -14,4 +14,4 @@
<%= govuk_link_to(question.update_answer_link_name(@case_log), "/logs/#{@case_log.id}/#{question.page.id.to_s.dasherize}").html_safe %> <%= govuk_link_to(question.update_answer_link_name(@case_log), "/logs/#{@case_log.id}/#{question.page.id.to_s.dasherize}").html_safe %>
</dd> </dd>
</div> </div>
<% end %> <% end %>

Loading…
Cancel
Save