diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index c340b41..082e3e0 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -4,7 +4,6 @@ class ArchivesController < ApplicationController cats = files_by_cateogry.keys.collect do |cat| files_by_category_tag = files_by_cateogry[cat].group_by(&:tags) - url_to_edit = OrbitHelper.user_has_cateogry?(cat) ? "/admin/archive_files?filters[category][]=#{cat.id.to_s}" : "" ts = [] files_by_category_tag.keys.each do |t| @@ -39,10 +38,13 @@ class ArchivesController < ApplicationController if t.count > 1 t.each do |inner_tag| index = ts.index{|tot| tot["tag-name"] == inner_tag.name} - if !index.nil? - ts[index]["archives"] << a + if index.nil? + ts << { + "tag-name" => (inner_tag.name rescue ""), + "archives" => [a] + } else - archives << a + ts[index]["archives"] << a end end else