Sha256: ef441f6054c18a556ab20248a695b150bc3812e8d694e34172a63336b3d5ce06

Contents?: true

Size: 540 Bytes

Versions: 9

Compression:

Stored size: 540 Bytes

Contents

module Dossier
  class ReportsController < ApplicationController
    include ViewContextWithReportFormatter

    self.responder = Dossier::Responder

    respond_to :html, :json, :csv, :xls

    def show
      respond_with(report)
    end

    def multi
      respond_with(report)
    end

    private

    def report_class
      Dossier::Naming.name_to_class(params[:report])
    end

    def report
      @report ||= report_class.new(options_params)
    end

    def options_params
      params[:options].presence || {}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dossier-2.12.2 app/controllers/dossier/reports_controller.rb
dossier-2.12.1 app/controllers/dossier/reports_controller.rb
dossier-2.12.0 app/controllers/dossier/reports_controller.rb
dossier-2.11.0 app/controllers/dossier/reports_controller.rb
dossier-2.10.0 app/controllers/dossier/reports_controller.rb
dossier-2.9.3 app/controllers/dossier/reports_controller.rb
dossier-2.9.2 app/controllers/dossier/reports_controller.rb
dossier-2.9.1 app/controllers/dossier/reports_controller.rb
dossier-2.9.0 app/controllers/dossier/reports_controller.rb