added url to edit

This commit is contained in:
Harry Bomrah 2015-09-11 14:29:38 +08:00
parent 9e40b65405
commit 631a6c645d
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ class ArchivesController < ApplicationController
files_by_cateogry = ArchiveFile.filter_by_categories.filter_by_tags.group_by(&:category) files_by_cateogry = ArchiveFile.filter_by_categories.filter_by_tags.group_by(&:category)
categories = files_by_cateogry.keys categories = files_by_cateogry.keys
cats = categories.collect do |category| cats = categories.collect do |category|
url_to_edit = OrbitHelper.user_has_cateogry?(cat) ? "/admin/archive_files?filters[category][]=#{cat.id.to_s}" : ""
archives = files_by_cateogry[category].collect do |archive| archives = files_by_cateogry[category].collect do |archive|
statuses = archive.statuses_with_classname.collect do |status| statuses = archive.statuses_with_classname.collect do |status|
{ {
@ -30,7 +31,8 @@ class ArchivesController < ApplicationController
end end
{ {
"category-title" => category.title, "category-title" => category.title,
"archives" => archives "archives" => archives,
"link_to_edit" => url_to_edit
} }
end end
{ {