Skip to content

Commit

Permalink
allow filtering on plant status
Browse files Browse the repository at this point in the history
  • Loading branch information
one-m1nd committed Mar 6, 2024
1 parent 1e78936 commit d88d10f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/plants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d88d10f

Please sign in to comment.