Fixed sample editing in samples table. [SCI-914]

This commit is contained in:
Matej Zrimšek 2017-01-20 11:05:05 +01:00
parent 1793e2a8f4
commit 5d65627808
2 changed files with 4 additions and 2 deletions

View file

@ -57,7 +57,7 @@ function dataTableInit() {
targets: 2,
render: function(data, type, row) {
return "<a href='" + row.sampleInfoUrl + "'" +
"class='sample-info-link'>" + data + '</a>';
"class='sample-info-link'>" + data + '</a>';
}
}],
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) {

View file

@ -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)
}