@@ -23,6 +23,7 @@ def index
2323 . order ( created_at : :desc )
2424 . class_filter ( filter_params )
2525 . during ( helpers . selected_range )
26+ @item_categories = current_organization . item_categories . pluck ( :name ) . uniq
2627 @paginated_donations = @donations . page ( params [ :page ] )
2728
2829 @product_drives = current_organization . product_drives . alphabetized
@@ -39,6 +40,7 @@ def index
3940 @selected_storage_location = filter_params [ :at_storage_location ]
4041 @sources = @donations . collect ( &:source ) . uniq . sort
4142 @selected_source = filter_params [ :by_source ]
43+ @selected_item_category = filter_params [ :by_category ]
4244 @donation_sites = @donations . collect ( &:donation_site ) . compact . uniq . sort_by { |site | site . name . downcase }
4345 @selected_donation_site = filter_params [ :from_donation_site ]
4446 @selected_product_drive = filter_params [ :by_product_drive ]
@@ -155,7 +157,7 @@ def donation_item_params
155157 def filter_params
156158 return { } unless params . key? ( :filters )
157159
158- params . require ( :filters ) . permit ( :at_storage_location , :by_source , :from_donation_site , :by_product_drive , :by_product_drive_participant , :from_manufacturer )
160+ params . require ( :filters ) . permit ( :at_storage_location , :by_source , :from_donation_site , :by_product_drive , :by_product_drive_participant , :from_manufacturer , :by_category )
159161 end
160162
161163 # Omits donation_site_id or product_drive_participant_id if those aren't selected as source
0 commit comments