Temporary open tags to allTemporary open tags to all

This commit is contained in:
chris 2013-04-25 19:45:46 +08:00
parent 73a0234330
commit 218592c1f9
2 changed files with 12 additions and 1 deletions

View File

@ -6,6 +6,8 @@ class Admin::ModuleTagsController < OrbitBackendController
# before_filter :force_order_for_user, except: [:index] # before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index] # before_filter :for_app_sub_manager, except: [:index]
# ======================================== # ========================================
before_filter :setup_vars
# ========================================
helper 'admin/tags' helper 'admin/tags'

View File

@ -6,6 +6,8 @@ class Admin::TagsController < OrbitBackendController
# before_filter :force_order_for_user, except: [:index] # before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index] # before_filter :for_app_sub_manager, except: [:index]
# ======================================== # ========================================
before_filter :setup_vars
# ========================================
def index def index
@tags = @module_app.module_tags @tags = @module_app.module_tags
@ -89,4 +91,11 @@ class Admin::TagsController < OrbitBackendController
redirect_to admin_tags_url redirect_to admin_tags_url
end 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 end