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
- #index ⇒ Object
-
#new ⇒ Object
NOTE: This needs to be POST since params may exceed url char limit in GET.
- #show ⇒ Object
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 47 def create requests.each(&:print_form) render( pdf: "create", layout: false, 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
NOTE: This needs to be POST since params may exceed url char limit in GET
35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 35 def new render( :new, layout: false, locals: local_vars.merge( all_clinics: Renalware::Pathology::Clinic.for_algorithm, all_consultants: Renalware::Pathology::Consultant.ordered, all_templates: Renalware::Pathology::Requests::Request::TEMPLATES ) ) end |
#show ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/renalware/pathology/requests/requests_controller.rb', line 21 def show request = RequestPresenter.new( Request.find(params[:id]) ) request render( pdf: "show", layout: false, locals: { request: request }, extra: "--no-print-media-type" # NOTE: Foundation CSS does not work well in print mode ) end |