Class: FoxTail::RangeComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::RangeComponent
- Includes:
- Concerns::Formable
- Defined in:
- app/components/fox_tail/range_component.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Instance Method Details
#before_render ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/fox_tail/range_component.rb', line 11 def before_render super add_default_name_and_id html_attributes[:type] = :range html_attributes[:value] ||= value_before_type_cast html_attributes[:disabled] = disabled? html_attributes[:class] = classnames theme.apply(:root, self), html_class range = self.range || within_range html_attributes.update("min" => range.min, "max" => range.max) if range end |
#call ⇒ Object
24 25 26 |
# File 'app/components/fox_tail/range_component.rb', line 24 def call tag.input(html_attributes) end |