Class: Spud::Admin::PostCommentsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/spud/admin/post_comments_controller.rb

Instance Method Summary collapse

Instance Method Details

#approveObject



39
40
41
42
43
44
45
46
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 39

def approve

	if Spud::Blog.enable_rakismet && @post_comment.spam
		@post_comment.ham!
	end
	@post_comment.update_attributes(:spam => false)
	redirect_to request.referer || spud_admin_post_comments_path
end

#createObject



35
36
37
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 35

def create

end

#destroyObject



56
57
58
59
60
61
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 56

def destroy
	if !@post_comment.destroy
		flash[:error] = "Whoops! Something odd happened while trying to delete that comment. Thats not fun. please try again."
	end
	respond_with @post_comment, :location => request.referer || spud_admin_post_comments_path
end

#editObject



27
28
29
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 27

def edit
	respond_with @post_comment
end

#indexObject



12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 12

def index
	@page_name = "Comments"
	if params[:post_id]
		@post_comments = SpudPost.find(params[:post_id]).comments
	else
		@post_comments = SpudPostComment
	end
	@post_comments = @post_comments.paginate :page => params[:page]
	respond_with @post_comments
end

#showObject



23
24
25
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 23

def show
	respond_with @post_comment
end

#spamObject



48
49
50
51
52
53
54
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 48

def spam
	if Spud::Blog.enable_rakismet && !@post_comment.spam
		@post_comment.spam!
	end
	@post_comment.update_attributes(:spam => true)
	redirect_to request.referer || spud_admin_post_comments_path
end

#updateObject



31
32
33
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 31

def update

end