{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/b3cc0833590c80e6335edd04cacfc734?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b3cc0833590c80e6335edd04cacfc734","url":"https://api.github.com/users/rahilsondhi","login":"rahilsondhi","id":804316},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-04T20:50:57Z","comments":1,"closed_at":null,"url":"https://api.github.com/repos/gregbell/active_admin/issues/721","body":"I'm writing AJAX Comments for an Article using Rails 3.1.1, ActiveAdmin 0.3.3, and jquery_ujs. When I hit the submit button to send the Comment, two XHR requests are sent. One is initiated by jquery.js:7951 (expected), and the other is initiated by active_admin/vendor.js:131 (unexpected). \r\n\r\nHere is that line:\r\n```\r\ng(\"abort\")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g(\"timeout\")},e.timeout);try{x.send(n===\"POST\"||n===\"PUT\"||n===\"DELETE\"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger(\"ajaxError\",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol===\"file:\"||a.status>=200&&a.status<300||a.status===304||a.status===\r\n```\r\n\r\nAs a workaround for the issue, I wrote a prevent_duplicate custom validation for my Comment model.","html_url":"https://github.com/gregbell/active_admin/issues/721","title":"Line 131 in /assets/active_admin/vendor.js causes a double POST","number":721,"id":2147265,"created_at":"2011-11-04T19:02:23Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/b3cc0833590c80e6335edd04cacfc734?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b3cc0833590c80e6335edd04cacfc734","url":"https://api.github.com/users/rahilsondhi","login":"rahilsondhi","id":804316},"updated_at":"2011-11-04T20:50:57Z","url":"https://api.github.com/repos/gregbell/active_admin/issues/comments/2636359","body":"Another workaround is to not make application.js require active_admin.js. A call to require_tree . will require active_admin.js, so instead change it to require_tree ./global and put all your JS files in there, except active_admin.\r\n\r\nassets/javascripts/:\r\n   active_admin.js\r\n   application.js\r\n\r\nassets/javascripts/application.js:\r\n   //= require_tree ./global\r\n\r\nassets/javascripts/global/:\r\n   all your other js files","id":2636359,"created_at":"2011-11-04T20:50:57Z"}}