Sha256: 4c32808c9689607596b2e596f6d42ccfba1e6f25a4c6398ea4e2081f7c13d7fb

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require_dependency "renalware/base_controller"

# Note we rely on template inheritance with this MDM Base class i.e. subclasses (e.g.
# HD::MDMPatientsController) can override templates and partials (e.g. add a _filters partial
# or override the _patient partial to replace what is displayed in the table).
# Otherwise the default template location is of course app/views/renalware/mdm_patients.
module Renalware
  class MDMPatientsController < BaseController
    include PresenterHelper
    include Renalware::Concerns::Pageable

    def render_index(**args)
      presenter = build_presenter(params: params, **args)
      authorize presenter.patients
      render :index, locals: { presenter: presenter }
    end

    def build_presenter(**args)
      query = args.fetch(:query)

      MDMPatientsPresenter.new(
        patients: query.call.page(page),
        page_title: args.fetch(:page_title),
        view_proc: args.fetch(:view_proc),
        q: query.search,
        patient_presenter_class: args[:patient_presenter_class]
      )
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta12 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta11 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta10 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta9 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta8 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta7 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta6 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta5 app/controllers/renalware/mdm_patients_controller.rb
renalware-core-2.0.0.pre.beta4 app/controllers/renalware/mdm_patients_controller.rb