fixed archive problem on orbit

This commit is contained in:
Harry Bomrah 2014-07-16 17:35:36 +08:00
parent 20f6dc8687
commit 3a2bdeb804
1 changed files with 9 additions and 5 deletions

View File

@ -25,16 +25,19 @@ 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)
title = (file.file_title.blank? ? File.basename(file.file.path) : file.file_title) rescue ""
extension = file.file.file.extension.downcase rescue ""
url = file.file.url rescue ""
{
"file-name" => title || "",
"file-type" => file.file.file.extension.downcase || "",
"file-url" => file.file.url || ""
"file-name" => title,
"file-type" => extension,
"file-url" => url
}
end
{
"archive-title" => archive.title || "",
"statuses" => statuses || [],
"statuses" => statuses,
"files" => files
}
end
@ -43,6 +46,7 @@ class ArchivesController < ApplicationController
"archives" => archives
}
end
{
"categories" => cats
}