Skip to content

Instantly share code, notes, and snippets.

@scottwb
Created February 18, 2012 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottwb/1857315 to your computer and use it in GitHub Desktop.
Save scottwb/1857315 to your computer and use it in GitHub Desktop.
Patch rails.js from rails/jquery-ujs to make it honor jQuery Mobile data-ajax
diff --git a/src/rails.js b/src/rails.js
index 06b4e0b..49ff0b2 100644
--- a/src/rails.js
+++ b/src/rails.js
@@ -174,6 +174,11 @@
if (target) { form.attr('target', target); }
+ var ajax = link.data('ajax');
+ if (ajax !== undefined) {
+ form.attr('data-ajax', ajax);
+ }
+
form.hide().append(metadata_input).appendTo('body');
form.submit();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment