Module: SimpleForm::Components::Labels::ClassMethods

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#translate_required_htmlObject


8
9
10
11
12
13
14
# File 'lib/simple_form/components/labels.rb', line 8

def translate_required_html
  i18n_cache :translate_required_html do
    I18n.t(:"required.html", scope: i18n_scope, default:
      %(<abbr title="#{translate_required_text}">#{translate_required_mark}</abbr>)
    )
  end
end

#translate_required_markObject


20
21
22
# File 'lib/simple_form/components/labels.rb', line 20

def translate_required_mark
  I18n.t(:"required.mark", scope: i18n_scope, default: '*')
end

#translate_required_textObject


16
17
18
# File 'lib/simple_form/components/labels.rb', line 16

def translate_required_text
  I18n.t(:"required.text", scope: i18n_scope, default: 'required')
end