Hi, I am working my way through the book, and have just completed iteration A4. I can load the index page with no problem, but when I click the link to create a new product I get the following error:
NoMethodError in Products#new
Showing layouts/products.html.erb where line #16 raised:
You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each
Extracted source (around line #16):
13: <h1>Listing products</h1>
15: <table cellpadding="5" cellspacing="0"> 16: <% for product in @products %>
I also get similar errors when using the other links on the page. Any idea what is causing this?