Add display link in files.

This commit is contained in:
BoHung Chiu 2021-03-23 19:01:49 +08:00
parent c348b8b782
commit 1d66537799
1 changed files with 14 additions and 0 deletions

View File

@ -46,6 +46,13 @@ class ArchivesController < ApplicationController
} }
end end
end end
if archive.url.present?
files << {
"file-name" => archive.title,
"file-type" => "link",
"file-url" => archive.url
}
end
archives << { archives << {
"archive-title" => archive.title, "archive-title" => archive.title,
"description" => archive.description, "description" => archive.description,
@ -102,6 +109,13 @@ class ArchivesController < ApplicationController
} }
end end
end end
if archive.url.present?
files << {
"file-name" => archive.title,
"file-type" => "link",
"file-url" => archive.url
}
end
{ {
"archive-title" => archive.title, "archive-title" => archive.title,
"description" => archive.description, "description" => archive.description,