Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!