
* Example before: location + '/mark_as_solved' /request_for_comments/30885?locale=de/mark_as_solved Now: //localhost:3333/request_for_comments/30885/mark_as_solved Note: https or http will be added automatically by browsers
18 lines
685 B
JavaScript
18 lines
685 B
JavaScript
$(document).on('turbolinks:load', function() {
|
|
if ($.isController('error_templates')) {
|
|
$('#add-attribute').find('button').on('click', function () {
|
|
$.ajax('//' + location.host + location.pathname + '/attribute.json', {
|
|
method: 'POST',
|
|
data: {
|
|
_method: 'PUT',
|
|
dataType: 'json',
|
|
error_template_attribute_id: $('#add-attribute').find('select').val()
|
|
}
|
|
}).done(function () {
|
|
location.reload();
|
|
}).fail(function (error) {
|
|
$.flash.danger({text: error.statusText});
|
|
});
|
|
});
|
|
}
|
|
}); |