RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: joserafael1990
In this part of the code
var states = new Array(); <% for state in @states %> states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <%= state.id %>)); <% end %>
Exactly in the for, I am having this error: undefined method `each' for nil:NilClass
In this part of the code
var states = new Array();
<% for state in @states %>
states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <%= state.id %>));
<% end %>
Exactly in the for, I am having this error: undefined method `each' for nil:NilClass