Sha256: cea47e73a93820b193b76323c31941737b77694c9e3fe75b999e7d487d3f9ccd

Contents?: true

Size: 504 Bytes

Versions: 25

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module Renderers
    class FacetedAttributeRenderer < AttributeRenderer
      private

      def li_value(value)
        link_to(ERB::Util.h(value), search_path(value))
      end

      def search_path(value)
        Rails.application.routes.url_helpers.search_catalog_path("f[#{search_field}][]": value, locale: I18n.locale)
      end

      def search_field
        ERB::Util.h(options.fetch(:search_field, field).to_s + "_sim")
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-5.0.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-5.0.0.rc3 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-5.0.0.rc2 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-5.0.0.rc1 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.6.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0.rc3 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0.rc2 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0.rc1 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.5.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0.beta2 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.4.2 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-4.0.0.beta1 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.4.1 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.4.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.3.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.2.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.1.0 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb
hyrax-3.0.2 app/renderers/hyrax/renderers/faceted_attribute_renderer.rb