Class: Geoblacklight::IconFacetItemComponent
- Inherits:
-
Blacklight::FacetItemComponent
- Object
- Blacklight::FacetItemComponent
- Geoblacklight::IconFacetItemComponent
- Defined in:
- app/components/geoblacklight/icon_facet_item_component.rb
Overview
Display facet values with a decorative icon
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(facet_item:) ⇒ IconFacetItemComponent
constructor
A new instance of IconFacetItemComponent.
Constructor Details
#initialize(facet_item:) ⇒ IconFacetItemComponent
Returns a new instance of IconFacetItemComponent.
10 11 12 13 14 15 |
# File 'app/components/geoblacklight/icon_facet_item_component.rb', line 10 def initialize(facet_item:, **) super # store a copy of the original label value @undecorated_label = @label end |
Instance Method Details
#before_render ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/components/geoblacklight/icon_facet_item_component.rb', line 17 def before_render # replace the original label with an icon-decorated version; this has to be done in # #before_render or #render so we have access to the icon helpers. @label = decorated_label super end |