module ActionView::Helpers::FormOptionsHelper

def country_options_for_select(selected = nil, priority_countries = nil)

def country_options_for_select(selected = nil, priority_countries = nil)
  country_options = "".html_safe
  if priority_countries
    priority_countries = [*priority_countries].map {|x| [x.html_safe,ISO3166::Country::NameIndex[x]] }
    country_options += options_for_select(priority_countries, selected)
    country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
  end
  countries = ISO3166::Country::Names.map{|(name,alpha2)| [name.html_safe,alpha2] }
  return country_options + options_for_select(countries, selected)
end

def country_select(object, method, priority_countries = nil, options = {}, html_options = {})

def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
  InstanceTag.new(object, method, self, options.delete(:object)).to_country_select_tag(priority_countries, options, html_options)
end