disables voting on comments for not allowed users

This commit is contained in:
Juanjo Bazán
2015-09-02 12:23:56 +02:00
parent 8915ce7ffd
commit 5c10435064

View File

@@ -3,17 +3,25 @@
</span>
&nbsp;|&nbsp;
<span class="in_favor">
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'yes'),
method: "post", remote: true do %>
<i class="icon-angle-up"></i>
<% end %>
<% else %>
<i class="icon-angle-up"></i>
<% end %>
<%= comment.total_likes %>
</span>
<span class="against">
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'no'),
method: "post", remote: true do %>
<i class="icon-angle-down"></i>
<% end %>
<% else %>
<i class="icon-angle-down"></i>
<% end %>
<%= comment.total_dislikes %>
</span>