Skip to content
This repository
Browse code

support for submit_to_remote in jquery driver

  • Loading branch information...
commit ff26ca68d26475f5ba9c3771d54f12a648c2374f 1 parent 8b7cd5a
Stephen St. Martin authored January 25, 2010 stefanpenner committed January 27, 2010
6  railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js
@@ -10,14 +10,14 @@ jQuery(function ($) {
10 10
             update      = el.attr('data-update-success'),
11 11
             position    = el.attr('data-update-position');
12 12
 
13  
-        console.log(e);
14  
-
15 13
         if (el.attr('data-submit')) {
16 14
             data = $('#' + el.attr('data-submit')).serializeArray();
17 15
         } else if (el.attr('data-with')) {
18 16
             data = el.attr('data-with');
19 17
         } else if(e.target.tagName.toUpperCase() == 'FORM') {
20 18
             data = el.serializeArray();
  19
+        } else if(e.target.tagName.toUpperCase() == 'INPUT') {
  20
+            data = el.closest('form').serializeArray();
21 21
         }
22 22
 
23 23
         if(condition) {
@@ -74,5 +74,5 @@ jQuery(function ($) {
74 74
     }
75 75
 
76 76
     $('form[data-remote="true"]').live('submit', handleRemote);
77  
-    $('a[data-remote="true"],input[data-remote="true"]').live('click', handleRemote);
  77
+    $('a[data-remote="true"],input[data-remote="true"],input[data-remote-submit="true"]').live('click', handleRemote);
78 78
 });

0 notes on commit ff26ca6

Please sign in to comment.
Something went wrong with that request. Please try again.