1
0

Added Ingredient visibility filter

Fixed index display (many? -> any? persisted)
This commit is contained in:
cryptogopher
2019-11-02 19:30:52 +01:00
parent 05c79782f5
commit 3294689cb4
8 changed files with 24 additions and 10 deletions

View File

@@ -223,6 +223,9 @@ class IngredientsController < ApplicationController
if filters[:name].present?
ingredients = ingredients.where("name LIKE ?", "%#{filters[:name]}%")
end
if filters[:visibility].present?
ingredients = ingredients.where(hidden: filters[:visibility] == "1" ? false : true)
end
ingredients
end
end