Topic: ActionView::TemplateError (undefined method `each' for nil:NilClass)
I am very new to Ruby on rails and I am trying to setup a web page that lists all the entries from a mysql database view.
I am getting the error below:
ctionView::TemplateError (undefined method `each' for nil:NilClass) on line #12 of app/views/yosemite_comparisons/_yosemite_comparisons_table.html.erb:
9: <th> </th>
12: <% @yosemite_comparisons.each do |yosemite_comparison| %>
14: <td><%=h yosemite_comparison.command_name %></td>
15: <td><%=h yosemite_comparison.current_load_test %></td>
Rendering /home/administrator/Projects/reporting/public/500.html (500 Internal Server Error)
After reading various posts, I understand that the collection object referenced in my code is NULL. But I don't understand why since I do have data into the database view associated.