def draw_label(bootstrap, method, for_attr: nil)
      options = bootstrap.label.dup
      text    = options.delete(:text)

      options[:for] = for_attr if for_attr.present?

      add_css_class!(options, "sr-only") if options.delete(:hide)
      add_css_class!(options, bootstrap.inline_margin_class) if bootstrap.inline?

      if bootstrap.horizontal?
        add_css_class!(options, "col-form-label")
        add_css_class!(options, bootstrap.label_col_class)
        add_css_class!(options, bootstrap.label_align_class)
      end

      label(method, text, options)
    end
def draw_label(bootstrap, method, for_attr: nil)
      options = bootstrap.label.dup
      text    = options.delete(:text)

      options[:for] = for_attr if for_attr.present?

      add_css_class!(options, "sr-only") if options.delete(:hide)
      add_css_class!(options, bootstrap.inline_margin_class) if bootstrap.inline?

      if bootstrap.horizontal?
        add_css_class!(options, "col-form-label")
        add_css_class!(options, bootstrap.label_col_class)
        add_css_class!(options, bootstrap.label_align_class)
      end

      label(method, text, options)
    end
Renders label for a given field. Takes following bootstrap options:

 :text   - replace default label text
 :class  - css class on the label
 :hide   - if `true` will render for screen readers only

 This is how those options can be passed in:

   text_field(:value, bootstrap: {label: {text: "Custom", class: "custom"}})

 You may also just set the label text by passing a string instead of label hash:

   text_field(:value, bootstrap: {label: "Custom Label"})