Class: Refinery::Blog::Admin::CommentsController
- Inherits:
-
AdminController
- Object
- AdminController
- Refinery::Blog::Admin::CommentsController
- Defined in:
- app/controllers/refinery/blog/admin/comments_controller.rb
Instance Method Summary collapse
Instance Method Details
#approved ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 18 def approved unless params[:id].present? @comments = Refinery::Blog::Comment.approved.page(params[:page]) render :action => 'index' else @comment = Refinery::Blog::Comment.find(params[:id]) @comment.approve! flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name) redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) end end |
#index ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 12 def index @comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) render :action => 'index' end |
#rejected ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 32 def rejected unless params[:id].present? @comments = Refinery::Blog::Comment.rejected.page(params[:page]) render :action => 'index' else @comment = Refinery::Blog::Comment.find(params[:id]) @comment.reject! flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name) redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil) end end |