Fix missing routes incompatible with a subpath

This commit is contained in:
Sebastian Serth
2021-11-03 16:02:21 +01:00
parent 7bda3f1950
commit eb69697b9a
8 changed files with 20 additions and 18 deletions

View File

@@ -1,7 +1,8 @@
$(document).on('turbolinks:load', function() {
if ($.isController('error_templates')) {
$('#add-attribute').find('button').on('click', function () {
$.ajax('//' + location.host + location.pathname + '/attribute.json', {
const button = $('#add-attribute').find('button')
button.on('click', function () {
$.ajax(Routes.attribute_error_template_path(button.data('template-id')), {
method: 'POST',
data: {
_method: 'PUT',
@@ -15,4 +16,4 @@ $(document).on('turbolinks:load', function() {
});
});
}
});
});