I am trying to pass an array of objects from js to rails
data.test = [{test: \'asdas\'}] $.ajax({ url: \'evaluate.json\', data: data, success: functio
Try this:
data.test = [{test: 'asdas'}] $.ajax({ url: 'evaluate.json', data: JSON.stringify(data), // Explicit JSON serialization contentType: 'application/json', // Overwrite the default content type: application/x-www-form-urlencoded success: function(data){ }, dataType : "json" });