Sha256: 11fcbc2ba895aad1cb2da68133380c94ae35d35ccec58c4ed33eb1c34ce878a7
Contents?: true
Size: 637 Bytes
Versions: 2
Compression:
Stored size: 637 Bytes
Contents
module ActionView module Helpers module FormOptionsHelper 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 def country_options_for_select geography = GeographyHelper::Countries.new geography.countries.invert end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
geography_helper-0.1.2 | lib/geography_helper/form_options_helper.rb |
geography_helper-0.1.1 | lib/geography_helper/form_options_helper.rb |