Added Ingredient visibility filter
Fixed index display (many? -> any? persisted)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user