Module: LocaleSelector::ControllerInstanceMethods
- Defined in:
- lib/locale_selector.rb
Instance Method Summary collapse
-
#offered_locales ⇒ Object
List of explicitely offered locales, as set during the initialization by #offer_locales.
-
#save_cookie(requested_lang) ⇒ Object
This helper saves the user locale selection in a cookie.
Instance Method Details
#offered_locales ⇒ Object
List of explicitely offered locales, as set during the initialization by #offer_locales
118 119 120 |
# File 'lib/locale_selector.rb', line 118 def offered_locales self.class.send :global_offered_locales end |
#save_cookie(requested_lang) ⇒ Object
This helper saves the user locale selection in a cookie. You can adjust the cookie path during the initialization with #offer_locales, use the :lang_cookie_path option.
125 126 127 128 129 130 131 |
# File 'lib/locale_selector.rb', line 125 def (requested_lang) [:lang] = { :value => requested_lang, :expires => 1.month.from_now, :path => root_path } end |