Module: ActionView::Helpers::FormOptionsHelper

Defined in:
lib/countries.rb

Instance Method Summary collapse

Instance Method Details

#country_options_for_select(selected = nil, priority_countries = nil) ⇒ Object



53
54
55
56
57
58
59
60
61
62
# File 'lib/countries.rb', line 53

def country_options_for_select(selected = nil, priority_countries = nil)
  country_options = ""

  if priority_countries
    country_options += options_for_select(priority_countries, selected)
    country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
  end

  return country_options + options_for_select(Country::Names, selected)
end

#country_select(object, method, priority_countries = nil, options = {}, html_options = {}) ⇒ Object



49
50
51
# File 'lib/countries.rb', line 49

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