Is there a better way to set data from a data attribute then
$.ajax({
url: $(this).data('update-url'),
type: "PUT",
data: {
batch_phase: {
"#{$(this).data('attribute')}": new Date().toUTCString()
}
}
});
I don't really like "#{$(this).data('attribute')}".