Skip to content

Is orthogonal data supported with this gem? #269

Closed
@gs2589

Description

@gs2589

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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions