Class: Admin::PostCommentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PostCommentsController
show all
- Includes:
- BlogUrlHelpers
- Defined in:
- app/controllers/admin/post_comments_controller.rb
Instance Method Summary
collapse
#admin_post_comments_path, #admin_post_path, #admin_post_post_comments_path, #admin_posts_path, #edit_admin_post_path, #new_admin_post_path, #post_archive_path, #post_category_archive_path, #post_category_path, #post_path, #posts_path
Instance Method Details
#approve ⇒ Object
35
36
37
38
39
40
41
42
43
|
# File 'app/controllers/admin/post_comments_controller.rb', line 35
def approve
if Spud::Blog.enable_rakismet && .spam
.ham!
end
.spam = false
.approved = true
.save()
redirect_to request.referer || (.post)
end
|
#create ⇒ Object
31
32
33
|
# File 'app/controllers/admin/post_comments_controller.rb', line 31
def create
end
|
#destroy ⇒ Object
55
56
57
58
59
60
|
# File 'app/controllers/admin/post_comments_controller.rb', line 55
def destroy
if !.destroy
flash[:error] = "Whoops! Something odd happened while trying to delete that comment. Thats not fun. please try again."
end
respond_with , :location => request.referer || (.post)
end
|
#edit ⇒ Object
23
24
25
|
# File 'app/controllers/admin/post_comments_controller.rb', line 23
def edit
respond_with
end
|
#index ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/admin/post_comments_controller.rb', line 8
def index
@page_name = "Comments"
if params[:post_id]
= .where(:spud_post_id => params[:post_id])
else
= .for_blog(params[:blog_key])
end
= .ordered.includes(:post).paginate(:page => params[:page], :per_page => 15)
respond_with
end
|
#show ⇒ Object
19
20
21
|
# File 'app/controllers/admin/post_comments_controller.rb', line 19
def show
respond_with
end
|
#spam ⇒ Object
45
46
47
48
49
50
51
52
53
|
# File 'app/controllers/admin/post_comments_controller.rb', line 45
def spam
if Spud::Blog.enable_rakismet && !.spam
.spam!
end
.spam = true
.approved = false
.save()
redirect_to request.referer || (.post)
end
|
#update ⇒ Object
27
28
29
|
# File 'app/controllers/admin/post_comments_controller.rb', line 27
def update
end
|