code-mancers/rapidfire

View on GitHub
app/views/rapidfire/answers/_radio.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 %>
  <%- answer.question.options.each_with_index do |option, index| %>
    <span class="form-group sub">
      <%= f.label "answer_text_#{index}" do %>
        <%= f.radio_button :answer_text, option, id: "#{f.object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")}_answer_text_#{index}" %>
        <%= option %>
      <% end %>
    </span>
  <% end %>
</div>