Module: LocaleSetter::Rails

Included in:
LocaleSetter
Defined in:
lib/locale_setter/rails.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#i18nObject

Returns the value of attribute i18n.



3
4
5
# File 'lib/locale_setter/rails.rb', line 3

def i18n
  @i18n
end

Instance Method Details

#default_url_options(options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/locale_setter/rails.rb', line 5

def default_url_options(options = {})
  if i18n.locale == i18n.default_locale
    options
  else
    {:locale => i18n.locale}.merge(options)
  end
end