Class: FoxTail::ToggleComponent

Inherits:
BaseComponent show all
Defined in:
app/components/fox_tail/toggle_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

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

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::BaseComponent

Instance Method Details

#before_renderObject



9
10
11
12
13
# File 'app/components/fox_tail/toggle_component.rb', line 9

def before_render
  super

  html_attributes[:type]
end

#callObject



15
16
17
18
19
20
21
# File 'app/components/fox_tail/toggle_component.rb', line 15

def call
   :label, container_attributes do
    concat (:input, nil, input_attributes)
    concat (:div, nil, toggle_attributes)
    concat label if label?
  end
end