Sha256: 4235d7d8b7ac25acad26263df9801dc635968af0394b241d7343088f41933d61

Contents?: true

Size: 640 Bytes

Versions: 9

Compression:

Stored size: 640 Bytes

Contents

class Admin::ReportsController < ApplicationController
  respond_to :json

  authorize_resource :admin, :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

9 entries across 9 versions & 1 rubygems

Version Path
simon_says-0.3.0.alpha.3 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.3.0.alpha.1 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.2.0 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.1.6 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.1.5 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.1.0 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.0.4 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.0.3 test/rails_app/app/controllers/admin/reports_controller.rb
simon_says-0.0.27b6 test/rails_app/app/controllers/admin/reports_controller.rb