fixed classname bug for statuses

This commit is contained in:
Harry Bomrah 2014-06-18 18:07:10 +08:00
parent 528c7da723
commit e75410d6a7
1 changed files with 8 additions and 7 deletions

View File

@ -17,12 +17,13 @@ class ArchivesController < ApplicationController
end end
end end
cats = @categories.collect do |cat| cats = @categories.collect do |cat|
archives = ArchiveFile.can_display.where(:category_id => cat["id"]).collect do |archive| archives = ArchiveFile.where(:category_id => cat["id"]).collect do |archive|
statuses = archive.statuses.collect do |status| statuses = archive.statuses_with_classname.collect do |status|
{ {
"archive-status" => status "status" => status["name"],
} "status-class" => "status-#{status['classname']}"
end }
end
files = archive.archive_file_multiples.collect do |file| files = archive.archive_file_multiples.collect do |file|
{ {
"file-name" => file.file_title, "file-name" => file.file_title,
@ -32,7 +33,7 @@ class ArchivesController < ApplicationController
end end
{ {
"archive-title" => archive.title, "archive-title" => archive.title,
"status" => statuses, "statuses" => statuses,
"files" => files "files" => files
} }
end end