Skip to content

Commit

Permalink
Move empty verb check into _getFormVerb
Browse files Browse the repository at this point in the history
  • Loading branch information
quirkey committed Jan 17, 2011
1 parent e8e475b commit 75c0e87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sammy.js
Expand Up @@ -1178,6 +1178,7 @@
$_method = $form.find('input[name="_method"]');
if ($_method.length > 0) { verb = $_method.val(); }
if (!verb) { verb = $form[0].getAttribute('method'); }
if (!verb || verb == '') { verb = 'get'; }
return $.trim(verb.toString().toLowerCase());
},

Expand All @@ -1187,7 +1188,6 @@
$form = $(form);
path = $form.attr('action');
verb = this._getFormVerb($form);
if (!verb || verb == '') { verb = 'get'; }
this.log('_checkFormSubmission', $form, path, verb);
if (verb === 'get') {
this.setLocation(path + '?' + this._serializeFormParams($form));
Expand Down

0 comments on commit 75c0e87

Please sign in to comment.