From ef5cd170a1f761425fdc3c20c21b99a260210c82 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 10 Jul 2014 15:48:38 +0800 Subject: [PATCH] filename displayed in frontend if file title not present --- app/controllers/archives_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 7957a95..35ed727 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -25,8 +25,9 @@ class ArchivesController < ApplicationController } end 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-url" => file.file.url }