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