Module: SubdomainLocale

Defined in:
lib/subdomain_locale/mapping.rb,
lib/subdomain_locale/railtie.rb,
lib/subdomain_locale/url_for.rb,
lib/subdomain_locale/controller.rb

Defined Under Namespace

Modules: Controller, UrlFor Classes: Mapping, Railtie

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_localeObject

Returns the value of attribute default_locale.



3
4
5
# File 'lib/subdomain_locale/mapping.rb', line 3

def default_locale
  @default_locale
end

.mappingObject

Returns the value of attribute mapping.



3
4
5
# File 'lib/subdomain_locale/mapping.rb', line 3

def mapping
  @mapping
end

Class Method Details

.default_fallback(locale) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/subdomain_locale/mapping.rb', line 6

def self.default_fallback(locale)
  if I18n.locale_available?(locale)
    locale
  else
    default_locale
  end
end