Module: Phlex::Rails::Helpers::Translate
- Defined in:
- lib/phlex/rails/helpers/translate.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #translate(key, **options) ⇒ Object (also: #t)
Class Method Details
.included(base) ⇒ Object
14 15 16 |
# File 'lib/phlex/rails/helpers/translate.rb', line 14 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#translate(key, **options) ⇒ Object Also known as: t
18 19 20 21 22 |
# File 'lib/phlex/rails/helpers/translate.rb', line 18 def translate(key, **) key = "#{self.class.translation_path}#{key}" if key.start_with?(".") helpers.t(key, **) end |