Sha256: 94ea462dab86b78abef43683b26168dd45c4e31caa23bfc1f98ea42d34793d04
Contents?: true
Size: 686 Bytes
Versions: 12
Compression:
Stored size: 686 Bytes
Contents
module ShelvesHelper 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(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(params.merge(page: nil, library_id: library.name, only_path: true))) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems