From aa0453e7dbfde913c17c72eaffec3295f6a62fb2 Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 7 Jun 2022 13:18:55 +0100 Subject: [PATCH] code for title format --- app/helpers/item_label_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/helpers/item_label_helper.rb b/app/helpers/item_label_helper.rb index 53051feb5..0d0f67cf0 100644 --- a/app/helpers/item_label_helper.rb +++ b/app/helpers/item_label_helper.rb @@ -2,4 +2,12 @@ module ItemLabelHelper def format_label(count, item) count > 1 ? item.pluralize : item end + + def format_title(path, searched, page_title, current_user, item_label, count) + if searched.present? + title = "#{page_title} (#{count} #{item_label} matching ‘#{searched}’)" + else + title = page_title + end + end end