Class: UI::SliderTrackComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SliderTrackComponent
- Includes:
- SliderTrackBehavior
- Defined in:
- app/view_components/ui/slider_track_component.rb
Overview
Slider Track component (ViewComponent) Background rail that contains the range
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", attributes: {}) ⇒ SliderTrackComponent
constructor
A new instance of SliderTrackComponent.
Methods included from SliderTrackBehavior
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ SliderTrackComponent
Returns a new instance of SliderTrackComponent.
15 16 17 18 |
# File 'app/view_components/ui/slider_track_component.rb', line 15 def initialize(classes: "", attributes: {}) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/view_components/ui/slider_track_component.rb', line 20 def call attrs = attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do content end end |