instance method default

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

default(locale, object, subject, options = {})

Evaluates defaults. If given subject is an Array, it walks the array and returns the first translation that can be resolved. Otherwise it tries to resolve the translation directly.

Parameters

locale req
object req
subject req
options opt = {}
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb, line 100
        def default(locale, object, subject, options = {})
          options = options.dup.reject { |key, value| key == :default }
          case subject
          when Array
            subject.each do |item|
              result = resolve(locale, object, item, options) and return result
            end and nil
          else
            resolve(locale, object, subject, options)
          end
        end

Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb line 100 · View on GitHub · Improve this page · Find usages on GitHub

Defined in I18n::Backend::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close