Remove destroy button from closed disputes

This commit is contained in:
Karl Erik Õunapuu 2020-05-07 16:22:48 +03:00
parent fabcdf9b7e
commit bd8ffb7e1d
2 changed files with 2 additions and 9 deletions

View file

@ -44,8 +44,8 @@ module Admin
# DELETE /admin/disputes/1
def delete
@dispute.destroy
redirect_to admin_disputes_url, notice: 'Dispute was successfully destroyed.'
@dispute.update(closed: true)
redirect_to admin_disputes_url, notice: 'Dispute was successfully closed.'
end
private

View file

@ -136,9 +136,6 @@
<th class="col-xs-2">
<%= sort_link(@q, 'comment') %>
</th>
<th class="col-xs-2">
<%= t(:actions) %>
</th>
</tr>
</thead>
<tbody>
@ -159,10 +156,6 @@
<td>
<%= x.comment %>
</td>
<td>
<%= link_to t(:delete), delete_admin_dispute_path(id: x.id),
data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger btn-xs' %>
</td>
</tr>
<% end %>
</tbody>