mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
Merge pull request #433 from mz3944/mz-sci-914
Edit of a sample in sample table does not work
This commit is contained in:
commit
18a2e4c423
2 changed files with 4 additions and 2 deletions
|
@ -57,7 +57,7 @@ function dataTableInit() {
|
||||||
targets: 2,
|
targets: 2,
|
||||||
render: function(data, type, row) {
|
render: function(data, type, row) {
|
||||||
return "<a href='" + row.sampleInfoUrl + "'" +
|
return "<a href='" + row.sampleInfoUrl + "'" +
|
||||||
"class='sample-info-link'>" + data + '</a>';
|
"class='sample-info-link'>" + data + '</a>';
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
rowCallback: function(row, data) {
|
rowCallback: function(row, data) {
|
||||||
|
@ -339,7 +339,7 @@ function onClickEdit() {
|
||||||
saveAction = "update";
|
saveAction = "update";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: rowData["sampleInfoUrl"],
|
url: rowData["sampleEditUrl"],
|
||||||
type: "GET",
|
type: "GET",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
|
@ -115,6 +115,8 @@ class SampleDatatable < AjaxDatatablesRails::Base
|
||||||
'6': record.user.full_name,
|
'6': record.user.full_name,
|
||||||
'sampleInfoUrl':
|
'sampleInfoUrl':
|
||||||
Rails.application.routes.url_helpers.sample_path(record.id),
|
Rails.application.routes.url_helpers.sample_path(record.id),
|
||||||
|
'sampleEditUrl':
|
||||||
|
Rails.application.routes.url_helpers.edit_sample_path(record.id),
|
||||||
'sampleUpdateUrl':
|
'sampleUpdateUrl':
|
||||||
Rails.application.routes.url_helpers.sample_path(record.id)
|
Rails.application.routes.url_helpers.sample_path(record.id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue