module LocaleMailer::ActionViewHelpers
Public Instance Methods
t(*args)
click to toggle source
Allow t to parse array retrieved from locale
Calls superclass method
# File lib/locale_mailer/actionview_helpers.rb, line 16 def t *args str = super opts = args.extract_options!.except(:throw, :raise) if str.is_a?(Array) and not opts.empty? str.map { |item| I18n.interpolate(item, opts) unless item.nil? }.map(&:to_s) else str end end
text(locale, opts = {})
click to toggle source
Retrieve and wrap a locale into a tag (p per default) If the locale sends back an array, build a collection of tags
# File lib/locale_mailer/actionview_helpers.rb, line 8 def text locale, opts = {} tag = opts.key?(:tag) ? opts.delete(:tag) : :p array_to_tags t(locale, opts), tag end