Merge pull request #2073 from consul/feature/2072#remove_question_valid_answers
Remove valid answers usage
This commit is contained in:
@@ -37,11 +37,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% question.valid_answers.each_with_index do |answer, i| %>
|
||||
<% question.question_answers.each_with_index do |answer, i| %>
|
||||
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
|
||||
<tr id="question_<%= question.id %>_<%= i %>_result">
|
||||
<td><%= answer %></td>
|
||||
<td class="text-center"><%= by_answer[answer].present? ? by_answer[answer].sum(&:amount) : 0 %></td>
|
||||
<td><%= answer.title %></td>
|
||||
<td class="text-center"><%= by_answer[answer.title].present? ? by_answer[answer.title].sum(&:amount) : 0 %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% question.valid_answers.each_with_index do |answer, i| %>
|
||||
<% question.question_answers.each_with_index do |answer, i| %>
|
||||
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
|
||||
<tr id="question_<%= question.id %>_<%= i %>_result">
|
||||
<td><%= answer %></td>
|
||||
<td><%= by_answer[answer].present? ? by_answer[answer].first.amount : 0 %></td>
|
||||
<td><%= answer.title %></td>
|
||||
<td><%= by_answer[answer.title].present? ? by_answer[answer.title].first.amount : 0 %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<div class="small-12 column">
|
||||
<h3><%= question.title %></h3>
|
||||
</div>
|
||||
<% question.valid_answers.each_with_index do |answer, i| %>
|
||||
<% question.question_answers.each_with_index do |answer, i| %>
|
||||
<div class="small-12 medium-6 large-3 column end">
|
||||
<label><%= answer %></label>
|
||||
<label><%= answer.title %></label>
|
||||
<%= text_field_tag "questions[#{question.id}][#{i}]", answer_result_value(question.id, i), placeholder: "0" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user