Code to support EmberJS + Discourse Tutorial feature: Admin Reports

This commit is contained in:
Robin Ward
2013-02-27 22:39:42 -05:00
parent 416f981f92
commit dc8e1196fd
11 changed files with 213 additions and 0 deletions

View File

@ -0,0 +1,17 @@
require_dependency 'report'
class Admin::ReportsController < Admin::AdminController
def show
report_type = params[:type]
raise Discourse::NotFound.new unless report_type =~ /^[a-z0-9\_]+$/
report = Report.find(report_type)
raise Discourse::NotFound.new if report.blank?
render_json_dump(report: report)
end
end