Module: Workarea::I18nHelper

Defined in:
app/helpers/workarea/i18n_helper.rb

Instance Method Summary collapse

Instance Method Details

#locale_optionsObject



3
4
5
6
7
# File 'app/helpers/workarea/i18n_helper.rb', line 3

def locale_options
  I18n.configured_locales.reduce([]) do |memo, locale|
    memo << [I18n.t(:name, locale: locale), locale]
  end
end

#switch_locale_fieldsObject



9
10
11
12
13
14
15
16
17
# File 'app/helpers/workarea/i18n_helper.rb', line 9

def switch_locale_fields
  result = ''

  params
    .except(:utf8, :controller, :action, :locale)
    .each_pair { |key, value| result << hidden_field_tag(key, value, id: nil) }

  result.html_safe
end