pundit: convert post votes to pundit.
Side effects:
* The data-current-user-is-voter <body> attribute has been removed.
* {{upvote:self}} no longer works. {{upvote:<name>}} should be used instead.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<strong>Score</strong>
|
||||
<span>
|
||||
<span id="score-for-post-<%= post.id %>"><%= post.score %></span>
|
||||
<% if CurrentUser.is_voter? %>
|
||||
<% if policy(PostVote).create? %>
|
||||
(vote <%= link_to(content_tag("i", nil, class: "far fa-thumbs-up"), post_post_votes_path(:score => "up", :post_id => post.id), :remote => true, :method => :post) %>/<%= link_to(content_tag("i", nil, class: "far fa-thumbs-down"), post_post_votes_path(:score => "down", :post_id => post.id), :remote => true, :method => :post) %>)
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user