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:
<tr>
<td align="right">Birth
Place</td><td><%= render
'birth_region', {person: 1} %></td>
</tr>
<tr>
<td
align="right"> </td><td><div
id="sel1"></div></td>
</tr>
ERB PARTIAL:
<% regions = %w(Africa America Antarctica Arctic Asia Atlantic Australia
Brazil Canada Chile Europe Indian Mexico Pacific US Other) %>
<select id="region<%= person %>"
name="region<%= person %>">
<option value="" selected="selected">--
Select Region
--</option>
<% regions.each do |region| %>
<option value="<%= region %>"><%= region
%></option>
<% end %>
</select>
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 = '<select name="zone1"><option
selected="selected"
value="">-- Nearest Location --</option>';
var reg = locations[selection];
for (var key in reg) {
menu += '<option value="' + key + '">'
+ reg[key] + '</option>';
}
menu += '</select>';
$('div#sel1').html(menu);
});
});
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/537F88D2.4090900%40gmail.com.
For more options, visit https://groups.google.com/d/optout.