pundit: convert favorite groups to pundit.

This commit is contained in:
evazion
2020-03-19 18:12:16 -05:00
parent 50fa674a3e
commit 2c4c29b81a
9 changed files with 80 additions and 54 deletions

View File

@@ -26,7 +26,7 @@
<%= time_ago_in_words_tagged(favgroup.updated_at) %>
<% end %>
<% t.column column: "control" do |favgroup| %>
<% if favgroup.editable_by?(CurrentUser.user) %>
<% if policy(favgroup).update? %>
<%= link_to "Edit", edit_favorite_group_path(favgroup) %> |
<%= link_to "Delete", favorite_group_path(favgroup), method: :delete, remote: true, "data-confirm": "Are you sure you want to delete this favgroup? This cannot be undone." %>
<% end %>