Class: Renalware::Patients::MDMsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Patients::MDMsController
- Includes:
- Pagy::Backend, Concerns::Pageable
- Defined in:
- app/controllers/renalware/patients/mdms_controller.rb
Defined Under Namespace
Classes: MDMListOptions, SqlView
Instance Method Summary collapse
-
#show ⇒ Object
rubocop:disable Metrics/MethodLength.
Methods inherited from BaseController
Instance Method Details
#show ⇒ Object
rubocop:disable Metrics/MethodLength
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/renalware/patients/mdms_controller.rb', line 22 def show Patient, :index? sql_view_klass = SqlView.new(view_name).klass sql_view_klass.reset_column_information search = sql_view_klass.ransack(params[:q]) view_proc = ->(patient) { patient_transplants_mdm_path(patient_id: patient.secure_id) } pagy, patients = pagy(search.result) = MDMListOptions.new( search: search, patients: patients.load, # search.result.page(page).per(5).load, current_view: current_view, view_proc: view_proc, pagination: pagy ) render locals: { options: } end |