Firefox select menu truncation - Rails or JQuery issue?

I have a Rails 4.1 app which has a “Region” select menu generated from a
partial and which displays fine. Based on which option is selected from
this menu I have a JQuery script which takes data from a “locations”
var/object and constructs a secondary “Location” select menu. Everything
works fine in Chrome and Safari but in the latest Firefox/Mac the
secondary menu is limited to the first 20 items. WAT?? Could this be a
Rails issue or an obscure Firefox bug?

gvim

ERB:


Birth Place <%= render
‘birth_region’, {person: 1} %>


 

ERB PARTIAL:
<% regions = %w(Africa America Antarctica Arctic Asia Atlantic Australia
Brazil Canada Chile Europe Indian Mexico Pacific US Other) %>

– Select Region

<% regions.each do |region| %>
<%= region %>
<% end %>

JQUERY:

var locations = {

“Africa”:{“Africa/Abidjan”:“Abidjan”,“Africa/Accra”:“Accra”,“Africa/Addis_Ababa”:“Addis
Ababa”,“Africa/Algiers”:“Algiers”,“Africa/Asmara”:“Asmara”,“Africa/Asmera”:“Asmera”,“Africa/Bamako”:“Bamako”,
… },

};

$(function() {
$(‘select#region1’).change(function() {
var selection = $(this).val();
var menu = ‘– Nearest Location –’;
var reg = locations[selection];
for (var key in reg) {
menu += ‘’ + reg[key] +
‘’;
}
menu += ‘’;
$(‘div#sel1’).html(menu);
});
});

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs