skill-assessment-app/app/views/quiz/_radio.html.erb
2016-08-08 17:08:20 -05:00

14 lines
476 B
Plaintext

<%
question.input_options.each do | option |
option_id = "#{option.parameterize}_#{question.to_i}"
radio_html = {class: 'radio', id: option_id}
answers = answer.try(:answer) || answer
%>
<div class="form-group-multiples">
<%= radio_button_tag('answer[radio]', option, (question.answer == option), radio_html) %>
<%= label_tag(option_id, option) %>
</div>
<% end %>
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>