Poll card now shows the responses to the poll in the public side
This commit is contained in:
Juan Salvador Pérez García
2018-07-27 20:11:19 +02:00
parent 741aae6846
commit 3d5390dfb0
2 changed files with 4 additions and 1 deletions

View File

@@ -113,4 +113,7 @@ class Poll < ActiveRecord::Base
related.nil?
end
def answer_count
Poll::Answer.where(question: questions).count
end
end

View File

@@ -13,7 +13,7 @@
</div>
<div class="card-section text-center">
<strong><%= t("dashboard.polls.poll.responses", count: poll.questions.count) %></strong>
<strong><%= t("dashboard.polls.poll.responses", count: poll.answer_count) %></strong>
</div>
<div class="card-section text-center">