Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
Create Edit & Delete Button on DataTables using AJAX ruby on rails

I am using DataTables with Ruby On Rails.

have the datasource setup for AJAX but i am trying to add an Edit Button to edit any record individually I have the following code

      $('#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
      });

What i am having problems with is how to change the "1" in this line to be {data: "id"}

              {title: 'Manage',
                  mRender: function (data, type, row) {
                      return '<%= link_to "Edit", edit_product_path(1) %>'
                  }
              }

Example

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda