Sha256: e720c281c6510a7449409bf95c81b5ddfe8dfd2bbe769a0f5fd44b7f005b335b
Contents?: true
Size: 371 Bytes
Versions: 6
Compression:
Stored size: 371 Bytes
Contents
class Object def as_(key, options = {}) if key.present? scope = [:active_scaffold, *options.delete(:scope)] options = options.reverse_merge(scope: scope, default: key.is_a?(String) ? key : key.to_s.titleize) text = I18n.t(key.to_s, **options).html_safe # text = nil if text.include?('translation missing:') end text || key end end
Version data entries
6 entries across 6 versions & 1 rubygems