module ActionView::Helpers::FormOptionsHelper

Public Instance Methods

country_options_for_select(selected=nil) click to toggle source
# File lib/geography_helper/form_options_helper.rb, line 14
def country_options_for_select(selected=nil)
  geography = GeographyHelper::Countries.new
  options_for_select(geography.countries.invert, selected)
end
state_options_for_select(selected=nil) click to toggle source
# File lib/geography_helper/form_options_helper.rb, line 5
def state_options_for_select(selected=nil)
  geography = GeographyHelper::States.new
  state_options = geography.states
  province_options = geography.provinces
  state_and_province_options = {'United States' => state_options['United States'].invert}.merge({'Canada' => province_options['Canada'].invert})

  grouped_options_for_select(state_and_province_options, selected)
end