Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/splendeo_translator.rb

Instance Method Summary collapse

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.



324
325
326
# File 'lib/splendeo_translator.rb', line 324

def translate_with_context(key, options={})
  SplendeoTranslator.translate_with_scope([self.controller_name, self.action_name], key, options)
end