diff options
author | Philip Arndt <parndt@gmail.com> | 2011-07-01 09:14:46 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2011-07-01 09:14:46 +1200 |
commit | 7028ef3dddd8559c8e5519431d3529c0c99872cc (patch) | |
tree | 6b8aa08e5f8713b85fc1bbf4a2460c001e516822 /app/controllers/admin/blog/comments_controller.rb | |
parent | 47a71b309f4fb364449167ddc6ed978b6969e047 (diff) | |
download | refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.tar.gz refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.tar.bz2 refinerycms-blog-7028ef3dddd8559c8e5519431d3529c0c99872cc.zip |
Making use of modules and putting classes under modules.
Diffstat (limited to 'app/controllers/admin/blog/comments_controller.rb')
-rw-r--r-- | app/controllers/admin/blog/comments_controller.rb | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb index f07abed..1868206 100644 --- a/app/controllers/admin/blog/comments_controller.rb +++ b/app/controllers/admin/blog/comments_controller.rb @@ -1,36 +1,40 @@ -class Admin::Blog::CommentsController < Admin::BaseController +module Admin + module Blog + class CommentsController < Admin::BaseController - crudify :blog_comment, - :title_attribute => :name, - :order => 'published_at DESC' + crudify :blog_comment, + :title_attribute => :name, + :order => 'published_at DESC' - def index - @blog_comments = BlogComment.unmoderated - render :action => 'index' - end + def index + @blog_comments = BlogComment.unmoderated + render :action => 'index' + end - def approved - unless params[:id].present? - @blog_comments = BlogComment.approved - render :action => 'index' - else - @blog_comment = BlogComment.find(params[:id]) - @blog_comment.approve! - flash[:notice] = t('approved', :scope => 'admin.blog.comments', :author => @blog_comment.name) - redirect_to :action => params[:return_to] || 'index' - end - end + def approved + unless params[:id].present? + @blog_comments = BlogComment.approved + render :action => 'index' + else + @blog_comment = BlogComment.find(params[:id]) + @blog_comment.approve! + flash[:notice] = t('approved', :scope => 'admin.blog.comments', :author => @blog_comment.name) + redirect_to :action => params[:return_to] || 'index' + end + end + + def rejected + unless params[:id].present? + @blog_comments = BlogComment.rejected + render :action => 'index' + else + @blog_comment = BlogComment.find(params[:id]) + @blog_comment.reject! + flash[:notice] = t('rejected', :scope => 'admin.blog.comments', :author => @blog_comment.name) + redirect_to :action => params[:return_to] || 'index' + end + end - def rejected - unless params[:id].present? - @blog_comments = BlogComment.rejected - render :action => 'index' - else - @blog_comment = BlogComment.find(params[:id]) - @blog_comment.reject! - flash[:notice] = t('rejected', :scope => 'admin.blog.comments', :author => @blog_comment.name) - redirect_to :action => params[:return_to] || 'index' end end - -end +end
\ No newline at end of file |