Correctly check if user can destroy a document

This commit is contained in:
Bertocq
2018-01-24 16:51:31 +01:00
parent c96e8d1203
commit 97ec551178

View File

@@ -12,7 +12,7 @@
class: 'button hollow' %>
</td>
<td class="text-center">
<% if can? :destroy, Document %>
<% if can?(:destroy, document) %>
<%= link_to t('documents.buttons.destroy_document'),
document_path(document, from: request.url), method: :delete,
data: { confirm: t('documents.actions.destroy.confirm') },