From 37b8b8555421cf8a9cca7026718a472e762af899 Mon Sep 17 00:00:00 2001 From: Matthew Fu Date: Wed, 18 Jan 2012 11:51:38 +0800 Subject: [PATCH] put setup APP var setup into Orbit class --- app/controllers/obit_frontend_component_controller.rb | 6 ++++++ .../panel/new_blog/front_end/posts_controller.rb | 8 -------- .../controllers/panel/new_blog/widget/posts_controller.rb | 8 -------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app/controllers/obit_frontend_component_controller.rb b/app/controllers/obit_frontend_component_controller.rb index d5bfaac6..06bb06a5 100644 --- a/app/controllers/obit_frontend_component_controller.rb +++ b/app/controllers/obit_frontend_component_controller.rb @@ -1,4 +1,10 @@ class ObitFrontendComponentController< ApplicationController + before_filter :setup_vars before_filter {|c| c.front_end_available(@app_title)} layout 'production' + + def setup_vars + @app_title = request.fullpath.split('/')[2] + end + end \ No newline at end of file diff --git a/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/front_end/posts_controller.rb b/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/front_end/posts_controller.rb index 2471e5fd..1aeb34b2 100644 --- a/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/front_end/posts_controller.rb +++ b/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/front_end/posts_controller.rb @@ -1,14 +1,6 @@ class Panel::NewBlog::FrontEnd::PostsController < ObitFrontendController - - - def initialize - super - @app_title = NewBlog::MOUDLEAPP_TITLE - end - # GET /posts # GET /posts.xml - def index @posts = Post.all end diff --git a/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/widget/posts_controller.rb b/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/widget/posts_controller.rb index 796155bc..dab532ee 100644 --- a/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/widget/posts_controller.rb +++ b/vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/widget/posts_controller.rb @@ -1,12 +1,4 @@ class Panel::NewBlog::Widget::PostsController < ObitWidgetController - - layout 'production' - - def initialize - super - @app_title = NewBlog::MOUDLEAPP_TITLE - end - # GET /posts # GET /posts.xml def index