Class: Blacklight::Response::SortComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::SortComponent
- Defined in:
- app/components/blacklight/response/sort_component.rb
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
- #dropdown ⇒ Object
-
#dropdown_class ⇒ Object
You may override this method in a subclass if you want to use a different dropdown component.
-
#initialize(search_state:, param: 'sort', choices: {}, id: 'sort-dropdown', classes: [], selected: nil) ⇒ SortComponent
constructor
A new instance of SortComponent.
Methods inherited from Component
Constructor Details
#initialize(search_state:, param: 'sort', choices: {}, id: 'sort-dropdown', classes: [], selected: nil) ⇒ SortComponent
Returns a new instance of SortComponent.
6 7 8 9 10 11 12 13 |
# File 'app/components/blacklight/response/sort_component.rb', line 6 def initialize(search_state:, param: 'sort', choices: {}, id: 'sort-dropdown', classes: [], selected: nil) @param = param @choices = choices @search_state = search_state @id = id @classes = classes @selected = selected end |
Instance Method Details
#dropdown ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/components/blacklight/response/sort_component.rb', line 20 def dropdown render(dropdown_class.new( param: @param, choices: @choices, id: @id, search_state: @search_state, selected: @selected )) end |
#dropdown_class ⇒ Object
You may override this method in a subclass if you want to use a different dropdown component
16 17 18 |
# File 'app/components/blacklight/response/sort_component.rb', line 16 def dropdown_class helpers.blacklight_config.view_config(:show).dropdown_component end |