4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/country_select/tag_helper.rb', line 4
def country_option_tags
option_tags_options = {
:selected => @options.fetch(:selected) { value(@object) },
:disabled => @options[:disabled]
}
if priority_countries.present?
priority_countries_options = country_options_for(priority_countries, false)
option_tags = options_for_select(priority_countries_options, option_tags_options)
option_tags += html_safe_newline + options_for_select([priority_countries_divider], disabled: priority_countries_divider)
if priority_countries.include?(option_tags_options[:selected])
option_tags_options[:selected] = nil
end
option_tags += html_safe_newline + options_for_select(country_options, option_tags_options)
else
option_tags = options_for_select(country_options, option_tags_options)
end
end
|