def custom_label(attribute, text, options, field_before_label = false, show_required = true)
      return block_given? ? yield.html_safe : "".html_safe if text == false

      text = default_label_text(object, attribute) if text.nil? || text == true
      text += required_for_attribute(attribute) if show_required

      text = if field_before_label && block_given?
               safe_join([yield, text.html_safe])
             elsif block_given?
               safe_join([text.html_safe, yield])
             end

      label(attribute, text, options || {})
    end
def custom_label(attribute, text, options, field_before_label = false, show_required = true)
      return block_given? ? yield.html_safe : "".html_safe if text == false

      text = default_label_text(object, attribute) if text.nil? || text == true
      text += required_for_attribute(attribute) if show_required

      text = if field_before_label && block_given?
               safe_join([yield, text.html_safe])
             elsif block_given?
               safe_join([text.html_safe, yield])
             end

      label(attribute, text, options || {})
    end
Private: Override method from FoundationRailsHelper to render the text of the
 label before the input, instead of after.

 attribute - The String name of the attribute we're build the label.
 text      - The String text to use as label.
 options   - A Hash to build the label.

 Returns a String.
 rubocop:disable Metrics/CyclomaticComplexity
 rubocop:disable Metrics/PerceivedComplexity