So I have this code to unobtrusively add dynamic delete links to my page. $(document).ready(function(){ $('.delete').click(ajaxDelete) }); function ajaxDelete(){ $.ajax({ type: "POST", data: {_method: "delete"}, url: this.href, dataType: "script", beforeSend: function(xhr) { confirm('are you sure?'); xhr.setRequestHeader("Accept", "text/javascript"); } }); return false; }
But upon updating from 1.1.4 to 1.2 it breaks, even with the compatibilty plugin. The links just break. It seems that rails isn't recognizing them as xhr requests and just returns the page html. However I am using ajaxForm in another place and that works. Any ideas?