add templates and submissions search

This commit is contained in:
Alex Turchyn
2023-09-15 02:11:48 +03:00
parent 7f6c0af0e8
commit 53fa35fd01
12 changed files with 101 additions and 23 deletions
+6
View File
@@ -17,4 +17,10 @@ module Templates
hash
end
def search(templates, keyword)
return templates if keyword.blank?
templates.where(Template.arel_table[:name].lower.matches("%#{keyword.downcase}%"))
end
end