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