Skip to content

Commit

Permalink
Correctly check if user can destroy a document
Browse files Browse the repository at this point in the history
  • Loading branch information
bertocq committed Jan 24, 2018
1 parent c96e8d1 commit 97ec551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/documents/_document.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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') },
Expand Down

0 comments on commit 97ec551

Please sign in to comment.