Class: Renalware::Pathology::Requests::RequestsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::Pathology::Requests::RequestsController
- Includes:
- Concerns::Pageable
- Defined in:
- app/controllers/renalware/pathology/requests/requests_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
PDF POST Displays multiple PDFs.
- #index ⇒ Object
-
#new ⇒ Object
HTML POST NOTE: This needs to be POST since params may exceed url char limit in GET.
-
#show ⇒ Object
Displays an historical PDF.
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
PDF POST Displays multiple PDFs
52 53 54 55 56 57 58 59 60 61 62 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 52 def create requests.each(&:print_form) render_with_wicked_pdf( pdf: "create", page_size: "A4", layout: "renalware/layouts/pdf", locals: local_vars, extra: "--no-print-media-type" # NOTE: Foundation CSS does not work well in print mode ) end |
#index ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 13 def index requests_query = RequestQuery.new(query_params) requests = requests_query.call.page(page).per(per_page) requests render :index, locals: { requests: requests, query: requests_query.search } end |
#new ⇒ Object
HTML POST NOTE: This needs to be POST since params may exceed url char limit in GET
39 40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 39 def new render( :new, locals: local_vars.merge( all_clinics: Renalware::Pathology::Clinic.for_algorithm, all_consultants: Renalware::Renal::Consultant.ordered, all_templates: Renalware::Pathology::Requests::Request::TEMPLATES ) ) end |
#show ⇒ Object
Displays an historical PDF
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 22 def show request = RequestPresenter.new( Request.find(params[:id]) ) request render_with_wicked_pdf( pdf: "show", page_size: "A4", layout: "renalware/layouts/pdf", locals: { request: request }, show_as_html: params.key?(:debug), extra: "--no-print-media-type" # NOTE: Foundation CSS does not work well in print mode ) end |