From 5d656278085fdb49990ae2b38a23f479c5a9f1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Fri, 20 Jan 2017 11:05:05 +0100 Subject: [PATCH] Fixed sample editing in samples table. [SCI-914] --- app/assets/javascripts/samples/sample_datatable.js.erb | 4 ++-- app/datatables/sample_datatable.rb | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index fcd25e9ff..ca1d20927 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -57,7 +57,7 @@ function dataTableInit() { targets: 2, render: function(data, type, row) { return "" + data + ''; + "class='sample-info-link'>" + data + ''; } }], rowCallback: function(row, data) { @@ -339,7 +339,7 @@ function onClickEdit() { saveAction = "update"; $.ajax({ - url: rowData["sampleInfoUrl"], + url: rowData["sampleEditUrl"], type: "GET", dataType: "json", success: function (data) { diff --git a/app/datatables/sample_datatable.rb b/app/datatables/sample_datatable.rb index 87411654f..2c354d4ff 100644 --- a/app/datatables/sample_datatable.rb +++ b/app/datatables/sample_datatable.rb @@ -115,6 +115,8 @@ class SampleDatatable < AjaxDatatablesRails::Base '6': record.user.full_name, 'sampleInfoUrl': Rails.application.routes.url_helpers.sample_path(record.id), + 'sampleEditUrl': + Rails.application.routes.url_helpers.edit_sample_path(record.id), 'sampleUpdateUrl': Rails.application.routes.url_helpers.sample_path(record.id) }