From bd8ffb7e1daa92fa86597b64cabc4ee3ac461f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 7 May 2020 16:22:48 +0300 Subject: [PATCH] Remove destroy button from closed disputes --- app/controllers/admin/disputes_controller.rb | 4 ++-- app/views/admin/disputes/index.html.erb | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin/disputes_controller.rb b/app/controllers/admin/disputes_controller.rb index 8292bc464..02773e4c7 100644 --- a/app/controllers/admin/disputes_controller.rb +++ b/app/controllers/admin/disputes_controller.rb @@ -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 diff --git a/app/views/admin/disputes/index.html.erb b/app/views/admin/disputes/index.html.erb index eea74f59a..3a72e7d41 100644 --- a/app/views/admin/disputes/index.html.erb +++ b/app/views/admin/disputes/index.html.erb @@ -136,9 +136,6 @@ <%= sort_link(@q, 'comment') %> - - <%= t(:actions) %> - @@ -159,10 +156,6 @@ <%= x.comment %> - - <%= link_to t(:delete), delete_admin_dispute_path(id: x.id), - data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger btn-xs' %> - <% end %>