Class: UI::SliderRangeComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SliderRangeComponent
- Includes:
- SliderRangeBehavior
- Defined in:
- app/view_components/ui/slider_range_component.rb
Overview
Slider Range component (ViewComponent) Filled portion of the track showing the selected value
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", attributes: {}) ⇒ SliderRangeComponent
constructor
A new instance of SliderRangeComponent.
Methods included from SliderRangeBehavior
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ SliderRangeComponent
Returns a new instance of SliderRangeComponent.
13 14 15 16 |
# File 'app/view_components/ui/slider_range_component.rb', line 13 def initialize(classes: "", attributes: {}) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'app/view_components/ui/slider_range_component.rb', line 18 def call attrs = attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, "", **attrs.merge(@attributes.except(:data)) end |