Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created March 16, 2012 03:30
Show Gist options
  • Save j-mcnally/2048362 to your computer and use it in GitHub Desktop.
Save j-mcnally/2048362 to your computer and use it in GitHub Desktop.
Remote inline forms rails 3
jQuery("input[type='submit']").live("click", function(e) {
e.preventDefault();
var targetForm = jQuery(this).closest("form");
if (jQuery(targetForm).attr("data-remote") == "true") {
jQuery.rails.handleRemote(jQuery(targetForm));
}
else {
jQuery(targetForm).submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment