From 631a6c645dd0e66f918470191ade7a50260ca8a1 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 11 Sep 2015 14:29:38 +0800 Subject: [PATCH] added url to edit --- app/controllers/archives_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index deeebb8..95c53c0 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -3,6 +3,7 @@ class ArchivesController < ApplicationController files_by_cateogry = ArchiveFile.filter_by_categories.filter_by_tags.group_by(&:category) categories = files_by_cateogry.keys 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| statuses = archive.statuses_with_classname.collect do |status| { @@ -30,7 +31,8 @@ class ArchivesController < ApplicationController end { "category-title" => category.title, - "archives" => archives + "archives" => archives, + "link_to_edit" => url_to_edit } end {