Added poll results view
This commit is contained in:
36
app/views/polls/results.html.erb
Normal file
36
app/views/polls/results.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<div class="row">
|
||||
<div class="small-12 medium-3 column sidebar">
|
||||
<h4>Preguntas</h4>
|
||||
<ul class="menu vertical">
|
||||
<%- @poll.questions.each do |question| %>
|
||||
<li><%=link_to question.title, "##{question.title.parameterize}" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%- @poll.questions.each do |question| %>
|
||||
<table>
|
||||
<h3 anchor="<%= question.title.parameterize %>"><%= question.title %></h3>
|
||||
<thead>
|
||||
<tr>
|
||||
<%- question.question_answers.each do |answer| %>
|
||||
<th scope="col" <%= answer.is_winner? ? "class=win" : "" %>><%= answer.title %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<%- question.question_answers.each do |answer| %>
|
||||
<td <%= answer.is_winner? ? "class=win" : "" %>>
|
||||
<%= answer.total_votes %>
|
||||
(<%= answer.total_votes_percentage %>%)
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user