Sha256: 1e2a4eaf6fbf897c3d899e3e5a62a607b54cd9d7cd4597f793d6e286736008d8
Contents?: true
Size: 953 Bytes
Versions: 28
Compression:
Stored size: 953 Bytes
Contents
module WithHelpIcon def label(wrapper_options = nil) "#{super} #{link_to_help}" end protected def link_to_help template.link_to '#', id: "#{input_class}_help", data: { toggle: 'popover'.freeze, content: metadata_help, 'original-title' => raw_label_text }, 'aria-label' => aria_label do help_icon end end def help_icon template.content_tag 'i', nil, 'aria-hidden' => true, class: "help-icon" end def metadata_help translate_from_namespace(:metadata_help) || attribute_name.to_s.humanize end def aria_label translate_from_namespace(:aria_label) || default_aria_label end def default_aria_label I18n.t("#{i18n_scope}.aria_label.#{lookup_model_names.join('.')}.default", title: attribute_name.to_s.humanize) end end
Version data entries
28 entries across 28 versions & 1 rubygems