Module: I18nLanguageSelect::FormHelpers

Defined in:
lib/i18n_language_select/form_helpers.rb

Instance Method Summary collapse

Instance Method Details

#language_code_select(object_name, method, priority_languages = nil, options = {}, html_options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/i18n_language_select/form_helpers.rb', line 3

def language_code_select(object_name, method, priority_languages = nil, options = {}, html_options = {})
  if Rails::VERSION::MAJOR >= 4
    instance_tag = ActionView::Helpers::Tags::Select.new(object_name, method, self, [], options, html_options)
    instance_tag.to_language_code_select_tag(priority_languages, html_options)
  else
    instance_tag = ActionView::Helpers::InstanceTag.new(object_name, method, self, options.delete(:object))
    instance_tag.to_language_code_select_tag(priority_languages, html_options, options)
  end
end