Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- Defined in:
- lib/translator.rb
Instance Method Summary collapse
-
#translate_with_context(key, options = {}) ⇒ Object
Add a
translate
(ort
) method to ActionController that is context-aware of what controller and action is being invoked.
Instance Method Details
#translate_with_context(key, options = {}) ⇒ Object
Add a translate
(or t
) method to ActionController that is context-aware of what controller and action is being invoked. Initial scoping will be [:controller_name :action_name] when looking up keys. Example would be [‘posts’ ‘show’] for the PostsController
and show
action.
299 300 301 |
# File 'lib/translator.rb', line 299 def translate_with_context(key, ={}) Translator.translate_with_scope([self.controller_name, self.action_name], key, ) end |