Class: ActionView::Helpers::InstanceTag

Inherits:
Object
  • Object
show all
Includes:
FormOptionsHelper
Defined in:
lib/config/initializers/intl_select.rb,
lib/config/initializers/intl_select.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from FormOptionsHelper

#intl_options_for_select, #intl_select

Instance Method Details

#to_intl_select_tag(choices, options, html_options) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/config/initializers/intl_select.rb', line 30

def to_intl_select_tag(choices, options, html_options)
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  value = value(object)
  selected_value = options.has_key?(:selected) ? options[:selected] : value
  ("select", add_options(intl_options_for_select(choices, selected_value), options, selected_value), html_options)
end