From d88d10fc48860e889bf1fece76fffe717de5eabb Mon Sep 17 00:00:00 2001 From: Xero Date: Wed, 6 Mar 2024 14:36:55 -0500 Subject: [PATCH] allow filtering on plant status --- app/controllers/plants_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/plants_controller.rb b/app/controllers/plants_controller.rb index 953c7ca..9a5e468 100644 --- a/app/controllers/plants_controller.rb +++ b/app/controllers/plants_controller.rb @@ -10,6 +10,8 @@ def index @plants.select! { |plant| plant.genus.name == params[:genus] } when params[:family].present? @plants.select! { |plant| plant.family.name == params[:family] } + when params[:status].present? + @plants.select! { |plant| plant.status.name == params[:status] } when params[:year_acquired].present? @plants.select! { |plant| plant.year_acquired == params[:year_acquired] } end