diff --git a/Authorization_with_Pundit/app/views/posts/_post.html.erb b/Authorization_with_Pundit/app/views/posts/_post.html.erb index 290b1e7..86cbeb7 100644 --- a/Authorization_with_Pundit/app/views/posts/_post.html.erb +++ b/Authorization_with_Pundit/app/views/posts/_post.html.erb @@ -4,7 +4,7 @@ <%= post.special? %> <%= link_to 'Show', post %> <%= link_to 'Edit', edit_post_path(post) %> - <% if true %> + <% if policy(post).destroy? %> <%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> \ No newline at end of file