Module: ActiveModel::Translation

Included in:
Edgar::Search
Defined in:
lib/core_ext/active_model.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) human_attribute_name_with_custom_fallback(attr, opt = {})

Column label I18n as follows (User.login as example):

  1. t('activerecord.attributes.user.login')

  2. t('login') # new feature added on original human_attribute_name

  3. options

  4. 'Login'



9
10
11
12
# File 'lib/core_ext/active_model.rb', line 9

def human_attribute_name_with_custom_fallback(attr, opt={})
  human_attribute_name_without_custom_fallback(attr,
      opt.merge(default: I18n.t(attr, default: attr.to_s.humanize)))
end