filename displayed in frontend if file title not present
This commit is contained in:
parent
d9194eae26
commit
ef5cd170a1
|
@ -25,8 +25,9 @@ class ArchivesController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
files = archive.archive_file_multiples.order_by(:sort_number=>'asc').collect do |file|
|
files = archive.archive_file_multiples.order_by(:sort_number=>'asc').collect do |file|
|
||||||
|
title = (file.file_title.blank? ? File.basename(file.file.path) : file.file_title)
|
||||||
{
|
{
|
||||||
"file-name" => file.file_title,
|
"file-name" => title ,
|
||||||
"file-type" => file.file.file.extension.downcase,
|
"file-type" => file.file.file.extension.downcase,
|
||||||
"file-url" => file.file.url
|
"file-url" => file.file.url
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue