Sha256: 85084394331926ace7520e8ece871aff48fa2747721dd526469aaeccfad9dba2

Contents?: true

Size: 676 Bytes

Versions: 4

Compression:

Stored size: 676 Bytes

Contents

class Admin::ReportsController < ApplicationController
  respond_to :json

  self.default_authorization_scope = :current_admin

  authorize :support
  find_resource :report, namespace: :admin, except: [:index, :new, :create]

  def index
    @reports = Admin::Report.all

    respond_with @reports
  end

  def create
    @report = Admin::Report.create(report_params)

    respond_with @report
  end

  def show
    respond_with @report
  end

  def update
    @report.update report_params

    respond_with @report
  end

  def destroy
    @report.destroy

    respond_with @report
  end

  protected

  def report_params
    params.require(:report).permit(:title)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simon_says-0.3.0.alpha.7 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.3.0.alpha.6 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.3.0.alpha.5 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.3.0.alpha.4 test/rails_app/app/controllers/admin/reports_controller.rb