I\'m using jquery_ujs to send a simple post request. I bound a callback function to the \"ajax:success\" event. However, this callback is being called twice for each success
One of a few things are happening.
Either you have multiple elements with .new_item class
alert($(".new_item").length);
you are sending the ajax request twice
alert("Sending Request");
$.ajax(...
or you are binding the event twice
alert("Binding Event");
$(".new_item").bind("ajax:success", function(xhr, data, status) {
Note: If you are using a modern browser, replace alerts with console.log()