Module: ActionView::Helpers::ToStateSelectTag

Included in:
InstanceTag, StateSelect
Defined in:
lib/i18n_plus/state.rb

Instance Method Summary collapse

Instance Method Details

#to_state_select_tag(country_code, options, html_options) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/i18n_plus/state.rb', line 41

def to_state_select_tag(country_code, 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(state_options_for_select(country_code, selected_value), options, value)
  (:select, opts, html_options)
end