public/rails_ext/rails_ext.js in rails-ext-0.3.25 vs public/rails_ext/rails_ext.js in rails-ext-0.3.27
- old
+ new
@@ -262,6 +262,18 @@
}
});
// it doesn't works
// $(document).ajaxError(function (e, r, o, e) {
// console.log(e);
-// });
\ No newline at end of file
+// });
+
+
+//
+// Helpers
+//
+// AJAX for autosubmitting changes
+$.callOnceForEvery('autosubmit', '._autosubmit', function() {
+ var e = $(this);
+ e.bind('change', function(){
+ $.post(e.dataAttr('action'), {value: e.val(), target: e.identify()})
+ });
+});