Permalink
Browse files

support for submit_to_remote in jquery driver

  • Loading branch information...
1 parent 8b7cd5a commit ff26ca68d26475f5ba9c3771d54f12a648c2374f @stevestmartin stevestmartin committed with stefanpenner Jan 26, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 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);
});

0 comments on commit ff26ca6

Please sign in to comment.