Module: ActionView::Helpers::ToLanguageSelectTag

Included in:
InstanceTag, LanguageSelect
Defined in:
lib/i18n_plus/language.rb

Instance Method Summary collapse

Instance Method Details

#to_language_select_tag(priority_language_codes, options, html_options) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/i18n_plus/language.rb', line 49

def to_language_select_tag(priority_language_codes, options, html_options)
  options.symbolize_keys!
  html_options.stringify_keys!
  add_default_name_and_id(html_options)
  _, value = option_text_and_value(object)
  selected_value = options.has_key?(:selected) ? options[:selected] : value
  opts = add_options(language_options_for_select(selected_value, *priority_language_codes), options, value)
  (:select, opts, html_options)
end