Method: SimpleForm::Components::Labels#label_html_options

Defined in:
lib/simple_form/components/labels.rb

#label_html_optionsObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/simple_form/components/labels.rb', line 48

def label_html_options
  label_html_classes = SimpleForm.additional_classes_for(:label) {
    [input_type, required_class, disabled_class, SimpleForm.label_class].compact
  }

  label_options = html_options_for(:label, label_html_classes)
  if options.key?(:input_html) && options[:input_html].key?(:id)
    label_options[:for] = options[:input_html][:id]
  end

  label_options
end