Class: Blacklight::Response::FacetGroupComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::FacetGroupComponent
- Defined in:
- app/components/blacklight/response/facet_group_component.rb
Overview
Render a group of facet fields
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
-
#initialize(response:, fields: [], title: nil, id: nil) ⇒ FacetGroupComponent
constructor
A new instance of FacetGroupComponent.
- #render? ⇒ Boolean
Methods inherited from Component
Constructor Details
#initialize(response:, fields: [], title: nil, id: nil) ⇒ FacetGroupComponent
Returns a new instance of FacetGroupComponent.
11 12 13 14 15 16 17 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 11 def initialize(response:, fields: [], title: nil, id: nil) @response = response @fields = fields @title = title @id = id ? "facets-#{id}" : 'facets' @panel_id = id ? "facet-panel-#{id}-collapse" : 'facet-panel-collapse' end |
Instance Method Details
#render? ⇒ Boolean
19 20 21 22 23 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 19 def render? Deprecation.silence(Blacklight::FacetsHelperBehavior) do helpers.has_facet_values?(@fields, @response) end end |