12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/country_select/tag_helper.rb', line 12
def country_option_tags
selected_option = @options.fetch(:selected) do
if self.method(:value).arity.zero?
value()
else
value(@object)
end
end
option_tags_options = {
selected: selected_option,
disabled: @options[:disabled]
}
if priority_countries.present?
options_for_select_with_priority_countries(country_options, option_tags_options)
else
options_for_select(country_options, option_tags_options)
end
end
|