From eaf841cc8484944d34abbb802171e18a5b7373a3 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Thu, 13 May 2021 12:37:04 +0200 Subject: [PATCH] Fix "Cancel" URL link The error `ActionController::RoutingError` is raised when the "Cancel" button is pressed, since the route entry for the action `Spree::Admin::CustomerReturnsController#show` is missing. In this case, we need to use the `edit` action. --- backend/app/views/spree/admin/reimbursements/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/views/spree/admin/reimbursements/edit.html.erb b/backend/app/views/spree/admin/reimbursements/edit.html.erb index 5d8adbbd48e..13b6f573f01 100644 --- a/backend/app/views/spree/admin/reimbursements/edit.html.erb +++ b/backend/app/views/spree/admin/reimbursements/edit.html.erb @@ -100,7 +100,7 @@ <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button btn btn-primary', method: 'post' } do %> <%= t('spree.reimburse') %> <% end %> - <%= link_to t('spree.actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), class: 'btn btn-default' %> + <%= link_to t('spree.actions.cancel'), url_for([:edit, :admin, @order, @reimbursement.customer_return]), class: 'btn btn-default' %> <% end %>