Skip to content

Instantly share code, notes, and snippets.

@rclements
Created April 14, 2015 20:17
Show Gist options
  • Save rclements/43a6765b8ec7cf3614dd to your computer and use it in GitHub Desktop.
Save rclements/43a6765b8ec7cf3614dd to your computer and use it in GitHub Desktop.
function removeTime(schedule_map_id, time_id, week, day) {
url = '/admin/schedule_maps/' + schedule_map_id + '/schedule_map_weeks/' + time_id
div = '#time_list_' + week + '_' + day
jQuery.ajax({
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
url: url,
type: 'delete',
dataType: 'json',
success: function(response) {
jQuery(div).html(response.responseText);
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment