Method: Admin::Blog::CommentsController#approved

Defined in:
app/controllers/admin/blog/comments_controller.rb

#approvedObject

approving comments if there is a request to approve comment showing all approved comments when params is not present



36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/admin/blog/comments_controller.rb', line 36

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('admin.blog.comments.approved', :author => @blog_comment.name)
    redirect_to :action => params[:return_to] || 'index'
  end
end