diff options
author | Stephen St. Martin <kuprishuz@gmail.com> | 2010-01-25 22:59:39 -0500 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:34 -0600 |
commit | ff26ca68d26475f5ba9c3771d54f12a648c2374f (patch) | |
tree | ab39665e96a3c3012df573020f98e43deb5067fe /railties/lib/generators | |
parent | 8b7cd5ae7ef2d8072779d756281f440f19f9500d (diff) | |
download | rails-ff26ca68d26475f5ba9c3771d54f12a648c2374f.tar.gz rails-ff26ca68d26475f5ba9c3771d54f12a648c2374f.tar.bz2 rails-ff26ca68d26475f5ba9c3771d54f12a648c2374f.zip |
support for submit_to_remote in jquery driver
Diffstat (limited to 'railties/lib/generators')
-rw-r--r-- | railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js b/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js index 46b403161b..1fa993cbb0 100644 --- a/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js +++ b/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js @@ -10,14 +10,14 @@ jQuery(function ($) { update = el.attr('data-update-success'), position = el.attr('data-update-position'); - console.log(e); - if (el.attr('data-submit')) { data = $('#' + el.attr('data-submit')).serializeArray(); } else if (el.attr('data-with')) { data = el.attr('data-with'); } else if(e.target.tagName.toUpperCase() == 'FORM') { data = el.serializeArray(); + } else if(e.target.tagName.toUpperCase() == 'INPUT') { + data = el.closest('form').serializeArray(); } if(condition) { @@ -74,5 +74,5 @@ jQuery(function ($) { } $('form[data-remote="true"]').live('submit', handleRemote); - $('a[data-remote="true"],input[data-remote="true"]').live('click', handleRemote); + $('a[data-remote="true"],input[data-remote="true"],input[data-remote-submit="true"]').live('click', handleRemote); }); |