Closed
Description
In my data table I have the following column definition:
columns:[
{data: "supplier",
render: function(data, type, row){
return data ? data.name : null
}
]
In my SearchResultDatatable#data method I have
def data
records.map do |record|
{
supplier: {name: record.supplier.try(:name)},
}
end
This is not working - I get the datatables.net/tn/4 error because
{name: record.supplier.try(:name)}
gets serialized as a string not an object- so data.name returns undefined.
Any thoughts on how to fix this?