Created
May 11, 2009 22:15
-
-
Save heim/110215 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SpamReportsController < ApplicationController | |
before_filter :authorize, :except => :create | |
skip_before_filter :verify_authenticity_token, :only => :create | |
def index | |
@spam_reports = SpamReport.unconfirmed.popular | |
end | |
def show | |
@spam_report = SpamReport.find(params[:id]) | |
end | |
def create | |
@comment = Comment.find(params[:comment_id]) | |
SpamReport.report_comment(@comment) | |
flash[:notice] = "Thank you for reporting spam." | |
respond_to do |format| | |
format.html { redirect_to episode_path(@comment.episode_id) } | |
format.js | |
end | |
end | |
def destroy | |
@spam_report = SpamReport.find(params[:id]) | |
@spam_report.destroy | |
flash[:notice] = "Successfully destroyed spam report." | |
redirect_to spam_reports_url | |
end | |
def confirm | |
@spam_report = SpamReport.find(params[:id]) | |
@spam_report.confirm! | |
flash[:notice] = "Successfully confirmed spam report." | |
redirect_to spam_reports_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment