I'm trying to append some parameters to a form before sending via ajax (via Rails UJS).
$(document).on("ajax:before",".form-example", function(event) {
event.data = $(":hidden").serialize();
});
The hidden inputs aren't within the form, so I need to collect them, serialize the, and add them to the request (which is a PUT
request). However, in the above example, no parameters are being passed to the server, am I doing something wrong? How can I pass parameter called "items"
with the serialized values of hidden inputs?