code-mancers/rapidfire

View on GitHub
app/views/rapidfire/answers/_checkbox.html.erb

Summary

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

<div class="form-group">
<%= f.label :answer_text, answer.question.question_text.html_safe %>
<%= 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 %>
</div>