Method: CommentsController#destroy

Defined in:
app/controllers/comments_controller.rb

#destroyObject



48
49
50
51
52
53
54
55
56
57
58
# File 'app/controllers/comments_controller.rb', line 48

def destroy
  @comment = Comment.find(params[:id])
  @comment.destroy
  respond_to do |format|
    format.html do
      flash[:notice] = 'Record deleted!'
      redirect_to post_path(@comment.post)
    end
    format.js { render :nothing => true }
  end
end