Sha256: 69616c1fde910b4000feea4ede90c2af3eb95bf6c16cc691563c532707381a77
Contents?: true
Size: 1.11 KB
Versions: 21
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true require_dependency "renalware/medications" module Renalware module Medications module HomeDelivery class PrescriptionsController < BaseController include Pagy::Backend def index form = SearchForm.new(search_params) query = Medications::Delivery::PrescriptionsDueForDeliveryQuery.new( drug_type_code: params[:named_filter], modality_description_id: form.modality_description_id, query: params[:q] ) pagy, prescriptions = pagy(query.call) authorize prescriptions render :index, locals: { prescriptions: prescriptions, pagy: pagy, query: query.search, form: form } end class SearchForm include ActiveModel::Model include Virtus::Model attribute :modality_description_id, Integer end def search_params return {} unless params.key?(:search) params.require(:search).permit(:modality_description_id) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems