2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'app/helpers/shelves_helper.rb', line 2
def library_shelf_facet(current_library, facet)
library = Library.where(name: facet.value).select([:name, :display_name]).first
return nil unless library
current = true if current_library.try(:name) == library.name
content_tag :li do
if current
content_tag :strong do
link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
end
else
link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
end
end
end
|