Class: Refinery::Blog::Admin::CommentsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/refinery/blog/admin/comments_controller.rb

Instance Method Summary collapse

Instance Method Details

#approveObject


22
23
24
25
26
27
28
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 22

def approve
  @comment = Refinery::Blog::Comment.find(params[:id])
  @comment.approve!
  flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name)

  redirect_to refinery.blog_admin_comments_path
end

#approvedObject


16
17
18
19
20
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 16

def approved
  @comments = Refinery::Blog::Comment.approved.page(params[:page])

  render :index
end

#indexObject


10
11
12
13
14
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 10

def index
  @comments = Refinery::Blog::Comment.unmoderated.page(params[:page])

  render :index
end

#rejectObject


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

def reject
  @comment = Refinery::Blog::Comment.find(params[:id])
  @comment.reject!
  flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name)

  redirect_to refinery.blog_admin_comments_path
end

#rejectedObject


30
31
32
33
34
# File 'app/controllers/refinery/blog/admin/comments_controller.rb', line 30

def rejected
  @comments = Refinery::Blog::Comment.rejected.page(params[:page])

  render :index
end