<%= render partial: "rapidfire/answers/errors", locals: {answer: answer} %>

<%= f.label :answer_text, answer.question.question_text %>
<%= f.fields_for :answer_text do |af| %>
  <%- answer.question.options.each_with_index do |option, index| %>
    <%= af.label index do %>
      <%= af.check_box index, { checked: checkbox_checked?(answer, option) }, option %>
      <%= option %>
    <% end %>
  <% end %>
<% end %>

<%= render partial: "rapidfire/answers/errors", locals: {answer: answer} %>

<%= f.label :answer_text, answer.question.question_text %>
<%= f.fields_for :answer_text do |af| %>
  <%- answer.question.options.each_with_index do |option, index| %>
    <%= af.label index do %>
      <%= check_box_tag "attempt[#{answer.question.id}][answer_text][#{index}]", option, checkbox_checked?(answer, option) %>
      <%= option %>
    <% end %>
  <% end %>
<% end %>

Use check_box_tag instead of builder.check_box When using builder.check_box, Rails inserts a hidden field with value 0, which: 1) When we have 0 as a value in our answer choices, chooses the wrong one if they leave any blank 2) When we do not have 0 as a value in our answer choices, it is impossible to pass validation of the field when they submit
Use check_box_tag instead of builder.check_box
When using builder.check_box, Rails inserts a hidden field with value 0, which:
1) When we have 0 as a value in our answer choices, chooses the wrong one if they leave any blank
2) When we do not have 0 as a value in our answer choices, it is impossible to pass validation of the field when they submit
