|
12 | 12 |
|
13 | 13 | <%= hidden_field_tag "question_number", @question_number %> |
14 | 14 |
|
15 | | - <%= f.govuk_radio_buttons_fieldset(:response, |
| 15 | + <%= f.govuk_radio_buttons_fieldset :response, |
16 | 16 | legend: { size: "l", text: title, tag: "h1" }, |
17 | | - hint: { text: @health_answer.hint }) do %> |
18 | | - <%= f.govuk_radio_button :response, "yes", |
19 | | - label: { text: "Yes" }, |
20 | | - link_errors: true do %> |
21 | | - <%= f.govuk_text_area :notes, |
22 | | - label: { text: "Give details" } %> |
| 17 | + hint: { text: @health_answer.hint } do %> |
| 18 | + <% if @health_answer.requires_notes? %> |
| 19 | + <%= f.govuk_radio_button :response, "yes", label: { text: "Yes" }, link_errors: true do %> |
| 20 | + <%= f.govuk_text_area :notes, label: { text: "Give details" } %> |
| 21 | + <% end %> |
| 22 | + <% else %> |
| 23 | + <%= f.govuk_radio_button :response, "yes", label: { text: "Yes" }, link_errors: true %> |
23 | 24 | <% end %> |
24 | | - <%= f.govuk_radio_button :response, "no", |
25 | | - label: { text: "No" } %> |
| 25 | + |
| 26 | + <%= f.govuk_radio_button :response, "no", label: { text: "No" } %> |
26 | 27 | <% end %> |
27 | 28 |
|
28 | 29 | <%= f.govuk_submit "Continue" %> |
|
0 commit comments