From 76980a89035fd5a6ef17ed679810aae9b6a8db9f Mon Sep 17 00:00:00 2001 From: Ilya Konanykhin Date: Wed, 18 Jan 2017 14:58:14 +0600 Subject: [PATCH] Fix: more explicit (and correct) time entries delete URL --- app/assets/javascripts/time_entries.js | 2 +- app/views/time_entries/index.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/time_entries.js b/app/assets/javascripts/time_entries.js index 78ba3c7..bbf4903 100644 --- a/app/assets/javascripts/time_entries.js +++ b/app/assets/javascripts/time_entries.js @@ -67,7 +67,7 @@ $(document).ready(function () { $("#confirmation_delete").click(function () { var entry_id = $(this).data("entry_id"); - var url = $("#confirmation_delete").data("url") + entry_id; + var url = $("#confirmation_delete").data("url-template").replace(/__ID__/, entry_id); $.ajax({ url: url, type: "delete", diff --git a/app/views/time_entries/index.haml b/app/views/time_entries/index.haml index bd9f502..17ce590 100644 --- a/app/views/time_entries/index.haml +++ b/app/views/time_entries/index.haml @@ -41,7 +41,7 @@ #work_entry_description Description .modal-footer %button.btn.btn-default(data-dismiss="modal" aria-hidden="true") Cancel - %button.btn.btn-danger#confirmation_delete(data-url="api/v1/time_entries/") Delete + %button.btn.btn-danger#confirmation_delete{data: {url_template: api_delete_time_entry_path('__ID__')}} Delete