Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda