Sha256: 2437e9c39c249b45a660fd0ec9a7f66267f6dec89c50abf2a6613fd91c4d81eb

Contents?: true

Size: 487 Bytes

Versions: 27

Compression:

Stored size: 487 Bytes

Contents

module Hyrax
  module Renderers
    class LinkedAttributeRenderer < 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(
            search_field: search_field, q: ERB::Util.h(value)
          )
        end

        def search_field
          options.fetch(:search_field, field)
        end
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
hyrax-1.0.4 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
hyrax-1.0.3 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
hyrax-1.0.2 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
hyrax-1.0.1 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
hyrax-1.0.0.rc2 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
hyrax-1.0.0.rc1 app/renderers/hyrax/renderers/linked_attribute_renderer.rb
test_hyrax-0.0.1.alpha app/renderers/hyrax/renderers/linked_attribute_renderer.rb