Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also list priority countries in their normal place alphabetically #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/localized_country_select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ def localized_country_options_for_select(selected = nil, priority_countries = ni
if priority_countries
country_options += options_for_select(LocalizedCountrySelect::priority_countries_array(priority_countries, options), selected)
country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n".html_safe
return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options) - LocalizedCountrySelect::priority_countries_array(priority_countries, options), selected)
else
return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options), selected)
selected = nil if priority_countries.include?(selected)
end
return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options), selected)
end
alias_method :country_options_for_select, :localized_country_options_for_select

Expand Down