From bb6e64b14c477bdd499f26ccc53ca2a4c0d3b928 Mon Sep 17 00:00:00 2001 From: Dave Jafari Date: Mon, 27 Aug 2012 00:56:21 -0500 Subject: [PATCH] form_for forces a POST or GET method, but adds a hidden field ("_method") with the correct HTTP verb, we should honor this --- src/rails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rails.js b/src/rails.js index 8de1faaa..ebada159 100644 --- a/src/rails.js +++ b/src/rails.js @@ -126,7 +126,7 @@ dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); if (element.is('form')) { - method = element.attr('method'); + method = element.find('[name=_method]').val() || element.attr('method'); url = element.attr('action'); data = element.serializeArray(); // memoized value from clicked submit button