Skip to content

Instantly share code, notes, and snippets.

View suweller's full-sized avatar
🕺

Steven Weller suweller

🕺
View GitHub Profile
module ActionView
module Helpers
module TranslationHelper
# Override translate method to consider translate_scope.
def translate(key, options = {})
I18n.translate(key, {:raise => I18n.raise_on_missing, :scope => (translate_scope.dup << options.delete(:add_scope)).compact}.merge(options))
end
alias :t :translate
# Append scopes to the current translation scope.