In a rails view the following:
<%= overlap_timeslots %> <%= overlap_timeslots.class %>
will display what is expected:
[145, 146, 147, 148, 149] Array
However the moment the following is inserted right after the above two objects,
<% overlap_timeslots.each do |ot| %>
...
<% end %>
rails complains with undefined method 'each' for nil
for the overlap_timeslots.each
statement. This is quite unexpected as the object is not nil two lines above.
What is causing this?