Class: Renalware::Transplants::WaitListsController

Inherits:
BaseController show all
Includes:
Concerns::Pageable
Defined in:
app/controllers/renalware/transplants/wait_lists_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Methods inherited from BaseController

#patient

Instance Method Details

#showObject

Here we display a named filter eg Active and query for patients based on registration status and also any search criteria entered in the search form which is backed by our ransack #search object.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/renalware/transplants/wait_lists_controller.rb', line 13

def show
  form = Registrations::WaitListForm.new(form_params)
  query = query_for(form)
  registrations = query.call.page(page).per(per_page || 50)
  authorize registrations
  render locals: {
    path_params: path_params,
    registrations: CollectionPresenter.new(registrations, WaitListRegistrationPresenter),
    q: query.search,
    form: form
  }
end