Module: SimpleForm::Components::Labels
- Defined in:
- lib/simple_form/components/labels.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/simple_form/components/labels.rb', line 4 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#label ⇒ Object
26 27 28 |
# File 'lib/simple_form/components/labels.rb', line 26 def label @builder.label(label_target, label_text, ) end |
#label_html_options ⇒ Object
38 39 40 41 42 |
# File 'lib/simple_form/components/labels.rb', line 38 def = (:label, [input_type, required_class]) [:for] = [:input_html][:id] if .key?(:input_html) && [:input_html].key?(:id) end |
#label_target ⇒ Object
34 35 36 |
# File 'lib/simple_form/components/labels.rb', line 34 def label_target attribute_name end |
#label_text ⇒ Object
30 31 32 |
# File 'lib/simple_form/components/labels.rb', line 30 def label_text SimpleForm.label_text.call(raw_label_text, required_label_text).html_safe end |