correct error mesages for all question types

This commit is contained in:
Mark Moser
2017-04-17 16:19:54 -05:00
parent 4d71ac7166
commit 235b4314a4
2 changed files with 14 additions and 15 deletions

View File

@ -1,15 +1,14 @@
<% answer_string = answer.try(:answer) || answer %>
<%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %>
<%
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
checked = answer_string == option.value ? 'checked' : ''
%>
<%
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
checked = answer_string == option.value ? 'checked' : ''
%>
<div class="">
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
<%= option.label(for: option_id) %>
</div>
<div class="">
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
<%= option.label(for: option_id) %>
</div>
<% end %>