diff --git a/app/assets/javascripts/error_templates.js b/app/assets/javascripts/error_templates.js index 74978157..3cb7dcaf 100644 --- a/app/assets/javascripts/error_templates.js +++ b/app/assets/javascripts/error_templates.js @@ -1,7 +1,7 @@ $(document).on('turbolinks:load', function() { if ($.isController('error_templates')) { $('#add-attribute').find('button').on('click', function () { - $.ajax(location + '/attribute.json', { + $.ajax('//' + location.host + location.pathname + '/attribute.json', { method: 'POST', data: { _method: 'PUT', diff --git a/app/assets/javascripts/external_users.js b/app/assets/javascripts/external_users.js index 058fdfa0..402c5473 100644 --- a/app/assets/javascripts/external_users.js +++ b/app/assets/javascripts/external_users.js @@ -17,7 +17,7 @@ $(document).on('turbolinks:load', function() { '; }; - var jqxhr = $.ajax(window.location.href + '/tag_statistics', { + var jqxhr = $.ajax('//' + location.host + location.pathname + '/tag_statistics', { dataType: 'json', method: 'GET' }); diff --git a/app/views/request_for_comments/show.html.slim b/app/views/request_for_comments/show.html.slim index d5cca4a3..2a16170d 100644 --- a/app/views/request_for_comments/show.html.slim +++ b/app/views/request_for_comments/show.html.slim @@ -109,7 +109,7 @@ javascript: $.ajax({ dataType: 'json', method: 'GET', - url: location + '/mark_as_solved' + url: '//' + location.host + location.pathname + '/mark_as_solved' }).done(function(response){ if(response.solved){ solvedButton.removeClass('btn-primary'); @@ -127,7 +127,7 @@ javascript: $.ajax({ dataType: 'json', method: 'POST', - url: location + '/set_thank_you_note', + url: '//' + location.host + location.pathname + '/set_thank_you_note', data: { note: value }