Class: Blacklight::Hierarchy::SelectedQfacetValueComponent
- Inherits:
-
QfacetValueComponent
- Object
- ViewComponent::Base
- QfacetValueComponent
- Blacklight::Hierarchy::SelectedQfacetValueComponent
- Defined in:
- app/components/blacklight/hierarchy/selected_qfacet_value_component.rb
Overview
Standard display of a SELECTED facet value, no link, special span with class, and ‘remove’ button.
Instance Attribute Summary collapse
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Attributes inherited from QfacetValueComponent
Instance Method Summary collapse
-
#initialize(field_name:, item:) ⇒ SelectedQfacetValueComponent
constructor
A new instance of SelectedQfacetValueComponent.
- #remove_href ⇒ Object
Methods inherited from QfacetValueComponent
#facet_config, #facet_item_presenter_class, #field_name_prefix, #hierarchy_config, #label_value, #path_for_facet, #render_facet_count
Constructor Details
#initialize(field_name:, item:) ⇒ SelectedQfacetValueComponent
Returns a new instance of SelectedQfacetValueComponent.
7 8 9 10 |
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 7 def initialize(field_name:, item:) @field_name = field_name @item = item end |
Instance Attribute Details
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
12 13 14 |
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 12 def field_name @field_name end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
12 13 14 |
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 12 def item @item end |
Instance Method Details
#remove_href ⇒ Object
14 15 16 |
# File 'app/components/blacklight/hierarchy/selected_qfacet_value_component.rb', line 14 def remove_href helpers.search_action_path(helpers.search_state.filter(field_name).remove(item.qvalue).params) end |