Correctly check if user can destroy a document
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
class: 'button hollow' %>
|
class: 'button hollow' %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<% if can? :destroy, Document %>
|
<% if can?(:destroy, document) %>
|
||||||
<%= link_to t('documents.buttons.destroy_document'),
|
<%= link_to t('documents.buttons.destroy_document'),
|
||||||
document_path(document, from: request.url), method: :delete,
|
document_path(document, from: request.url), method: :delete,
|
||||||
data: { confirm: t('documents.actions.destroy.confirm') },
|
data: { confirm: t('documents.actions.destroy.confirm') },
|
||||||
|
|||||||
Reference in New Issue
Block a user