Class: ActionView::Helpers::InstanceTag

Inherits:
Object
  • Object
show all
Defined in:
lib/countries/select_helper.rb

Instance Method Summary collapse

Instance Method Details

#to_country_select_tag(priority_countries, options, html_options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/countries/select_helper.rb', line 24

def to_country_select_tag(priority_countries, options, html_options)
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  value = options.delete(:selected) || value(object)
  ("select",
    add_options(
      country_options_for_select(value, priority_countries),
      options, value
    ), html_options
  )
end