Sha256: 280fd19760ab5629a78969814359abbabd2a0d2583d068036847deb158d2d7f6
Contents?: true
Size: 944 Bytes
Versions: 12
Compression:
Stored size: 944 Bytes
Contents
module Curate::CatalogHelper def type_tab(label, key=label) if params[:f] && params[:f][type_field] == [key] content_tag(:li, link_to(label, "#"), class: "active") else local_params = params.dup local_facet_params = local_params[:f] || {}.with_indifferent_access local_params[:f] = local_facet_params.select{|k,_| k != type_field } content_tag(:li, link_to(label, add_facet_params(type_field, key, local_params))) end end def all_type_tab(label = "All") if params[:f] && params[:f][type_field] local_params = params.dup local_params[:f] = local_params[:f].select{|k,_| k != type_field } local_params.delete(:f) if local_params[:f].empty? content_tag(:li, link_to(label, local_params)) else content_tag(:li, link_to(label, '#'), class: "active") end end private def type_field Solrizer.solr_name("generic_type", :facetable) end end
Version data entries
12 entries across 12 versions & 1 rubygems