Class: StatePickerInput
Instance Method Summary
collapse
#input, #input_html_classes
Instance Method Details
#collection ⇒ Object
6
7
8
9
10
11
12
|
# File 'app/inputs/state_picker_input.rb', line 6
def collection
states_select = []
country_isos.each do |iso|
states_select += ISO3166::Country[iso].subdivisions.map { |k, v| [v.name || k, k] }
end
states_select.sort_by(&:first)
end
|
#country_isos ⇒ Object
2
3
4
|
# File 'app/inputs/state_picker_input.rb', line 2
def country_isos
options[:country_isos] || %w[US CA]
end
|