Files
grecia/app/views/polls/questions/_answers.html.erb
María Checa 9871503c5e Restored views
2017-10-03 21:00:40 +02:00

23 lines
791 B
Plaintext

<div class="poll-question-answers">
<% if can? :answer, question %>
<% question.valid_answers.each do |answer| %>
<% if @answers_by_question_id[question.id] == answer %>
<span class="button answered" title="<%= t("poll_questions.show.voted", answer: answer)%>">
<%= answer %>
</span>
<% else %>
<%= link_to answer,
answer_question_path(question, answer: answer),
method: :post,
remote: true,
title: t("poll_questions.show.vote_answer", answer: answer),
class: "button secondary hollow" %>
<% end %>
<% end %>
<% else %>
<% question.valid_answers.each do |answer| %>
<span class="button secondary hollow disabled"><%= answer %></span>
<% end %>
<% end %>
</div>