I have a specific ajax form that requires serialization and the manual setting of the _method for the data form. This is how I am currently handling it.
$.ajax({
url: http://someposturl.com/object,
type: 'POST',
data: {
_method: method
},
data: $('form').serialize(),
success: function(json) {
alert("Success!");
},
error: function(json){
alert("Error!"):
}
});
However, the issue is that the data variable is getting overwritten in the above implementation.
How can I adjust this code to ensure that the data includes both the _method and the serialized form?