Class: BlacklightRangeLimit::FacetItemPresenter

Inherits:
Blacklight::FacetItemPresenter
  • Object
show all
Defined in:
app/presenters/blacklight_range_limit/facet_item_presenter.rb

Overview

Override the default item presenter to provide custom labels for range data.

Instance Method Summary collapse

Instance Method Details

#href(path_options = {}) ⇒ Object

Very hacky way to keep params used for ajax query for segments out of our generated facet links. Sorry this seems to be the best way!

github.com/projectblacklight/blacklight_range_limit/issues/296



15
16
17
18
# File 'app/presenters/blacklight_range_limit/facet_item_presenter.rb', line 15

def href(path_options = {})
  override_to_nil = BlacklightRangeLimit::ControllerOverride::RANGE_LIMIT_FIELDS.collect { |f| [f, nil] }.to_h
  super(path_options.merge(override_to_nil))
end

#labelObject



7
8
9
# File 'app/presenters/blacklight_range_limit/facet_item_presenter.rb', line 7

def label
  label_for_range || super
end