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