Class: FoxTail::LabelComponent

Inherits:
BaseComponent show all
Includes:
Concerns::Formable
Defined in:
app/components/fox_tail/label_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



10
11
12
13
14
15
16
# File 'app/components/fox_tail/label_component.rb', line 10

def before_render
  super

  update_state_from_object!
  html_attributes[:for] ||= tag_id_for_value value
  html_attributes[:class] = classnames theme.apply(:root, self), html_class
end

#callObject



18
19
20
# File 'app/components/fox_tail/label_component.rb', line 18

def call
   :label, retrieve_content, html_attributes
end