Class: Spud::Admin::PostCommentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Spud::Admin::PostCommentsController
- Defined in:
- app/controllers/spud/admin/post_comments_controller.rb
Instance Method Summary collapse
- #approve ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #show ⇒ Object
- #spam ⇒ Object
- #update ⇒ Object
Instance Method Details
#approve ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 39 def approve if Spud::Blog. && @post_comment.spam @post_comment.ham! end @post_comment.update_attributes(:spam => false) redirect_to request.referer || spud_admin_post_comments_path end |
#create ⇒ Object
35 36 37 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 35 def create end |
#destroy ⇒ Object
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 |
#edit ⇒ Object
27 28 29 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 27 def edit respond_with @post_comment end |
#index ⇒ Object
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 |
#show ⇒ Object
23 24 25 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 23 def show respond_with @post_comment end |
#spam ⇒ Object
48 49 50 51 52 53 54 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 48 def spam if Spud::Blog. && !@post_comment.spam @post_comment.spam! end @post_comment.update_attributes(:spam => true) redirect_to request.referer || spud_admin_post_comments_path end |
#update ⇒ Object
31 32 33 |
# File 'app/controllers/spud/admin/post_comments_controller.rb', line 31 def update end |