From 218592c1f912912bdd9d54975d54005f22a2d29e Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 25 Apr 2013 19:45:46 +0800 Subject: [PATCH] Temporary open tags to allTemporary open tags to all --- app/controllers/admin/module_tags_controller.rb | 2 ++ app/controllers/admin/tags_controller.rb | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/module_tags_controller.rb b/app/controllers/admin/module_tags_controller.rb index 7a71c39a4..7b04d8143 100644 --- a/app/controllers/admin/module_tags_controller.rb +++ b/app/controllers/admin/module_tags_controller.rb @@ -6,6 +6,8 @@ class Admin::ModuleTagsController < OrbitBackendController # before_filter :force_order_for_user, except: [:index] # before_filter :for_app_sub_manager, except: [:index] # ======================================== + before_filter :setup_vars + # ======================================== helper 'admin/tags' diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb index bbb5a2055..05a2ad982 100644 --- a/app/controllers/admin/tags_controller.rb +++ b/app/controllers/admin/tags_controller.rb @@ -1,11 +1,13 @@ class Admin::TagsController < OrbitBackendController include OrbitTag::Merging - + # TODO = put back ======================== # before_filter :force_order_for_visitor, only: [:index] # before_filter :force_order_for_user, except: [:index] # before_filter :for_app_sub_manager, except: [:index] # ======================================== + before_filter :setup_vars + # ======================================== def index @tags = @module_app.module_tags @@ -89,4 +91,11 @@ class Admin::TagsController < OrbitBackendController redirect_to admin_tags_url end + protected + + def setup_vars + @app_title ||= controller_path.split('/')[1].singularize + @module_app ||= ModuleApp.first(conditions: {:key => @app_title} ) + raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil? + end end