aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-09-19 18:43:09 -0700
committerJamie Winsor <jamie@enmasse.com>2011-09-19 18:43:09 -0700
commitde4cc6b9efdba3e1eeb398f01a46331b80895314 (patch)
treebf08680f5029180fde7fe3aa38d05d34a8ac83af
parentc40eb83af3c85e15314fab75cf66e2ffe3ab2ed7 (diff)
downloadrefinerycms-blog-de4cc6b9efdba3e1eeb398f01a46331b80895314.tar.gz
refinerycms-blog-de4cc6b9efdba3e1eeb398f01a46331b80895314.tar.bz2
refinerycms-blog-de4cc6b9efdba3e1eeb398f01a46331b80895314.zip
Namespace BlogControllerHelper to Blog::ControllerHelper
-rw-r--r--app/controllers/refinery/blog_controller.rb2
-rw-r--r--app/helpers/refinery/blog/controller_helper.rb30
-rw-r--r--app/helpers/refinery/blog_controller_helper.rb28
3 files changed, 31 insertions, 29 deletions
diff --git a/app/controllers/refinery/blog_controller.rb b/app/controllers/refinery/blog_controller.rb
index b875b44..314c919 100644
--- a/app/controllers/refinery/blog_controller.rb
+++ b/app/controllers/refinery/blog_controller.rb
@@ -1,7 +1,7 @@
module Refinery
class BlogController < ::ApplicationController
- include BlogControllerHelper
+ include Blog::ControllerHelper
helper :'refinery/blog_posts'
before_filter :find_page, :find_all_blog_categories
diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb
new file mode 100644
index 0000000..74a189b
--- /dev/null
+++ b/app/helpers/refinery/blog/controller_helper.rb
@@ -0,0 +1,30 @@
+module Refinery
+ module Blog
+ module ControllerHelper
+
+ protected
+
+ def find_blog_post
+ unless (@blog_post = Refinery::BlogPost.find(params[:id])).try(:live?)
+ if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog")
+ @blog_post = Refinery::BlogPost.find(params[:id])
+ else
+ error_404
+ end
+ end
+ end
+
+ def find_all_blog_posts
+ @blog_posts = Refinery::BlogPost.live.includes(:comments, :categories).page(params[:page])
+ end
+
+ def find_tags
+ @tags = Refinery::BlogPost.tag_counts_on(:tags)
+ end
+
+ def find_all_blog_categories
+ @blog_categories = Refinery::BlogCategory.all
+ end
+ end
+ end
+end
diff --git a/app/helpers/refinery/blog_controller_helper.rb b/app/helpers/refinery/blog_controller_helper.rb
deleted file mode 100644
index 2edc2f6..0000000
--- a/app/helpers/refinery/blog_controller_helper.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module Refinery
- module BlogControllerHelper
-
- protected
-
- def find_blog_post
- unless (@blog_post = Refinery::BlogPost.find(params[:id])).try(:live?)
- if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog")
- @blog_post = Refinery::BlogPost.find(params[:id])
- else
- error_404
- end
- end
- end
-
- def find_all_blog_posts
- @blog_posts = Refinery::BlogPost.live.includes(:comments, :categories).page(params[:page])
- end
-
- def find_tags
- @tags = Refinery::BlogPost.tag_counts_on(:tags)
- end
-
- def find_all_blog_categories
- @blog_categories = Refinery::BlogCategory.all
- end
- end
-end