Estoy usando DataTables con Ruby On Rails.
tengo la configuración de la fuente de datos para AJAX pero estoy tratando de agregar un botón Editar para editar cualquier registro individualmente. Tengo el siguiente código
$('#table').DataTable({ ajax: '/get_dataset', columns: [ {data: "id", sortable: false, bVisible: false}, {title: 'Supplier', data: 'supplier'}, {title: 'UPC', data: 'upc_fixed'}, {title: 'Product Code', data: 'product_code'}, {title: 'Category', data: 'category'}, {title: 'Description', data: 'description'}, {title: 'Item Count', data: 'item_count'}, {title: 'Manage', mRender: function (data, type, row) { return '<%= link_to "Edit", edit_product_path(1) %>' } } ], pageLength: 25 });
Lo que tengo problemas es cómo cambiar el "1"
en esta línea para que sea {data: "id"}
{title: 'Manage', mRender: function (data, type, row) { return '<%= link_to "Edit", edit_product_path(1) %>' } }