Getting NoMethodErrors after completing A4
Mark McCollum
2 posts
|
Hi, NoMethodError in Products#new Showing layouts/products.html.erb where line #16 raised: You have a nil object when you didn’t expect it! Extracted source (around line #16): 13: Listing products14: 15: <table cellspacing="0" cellpadding="5"> 16: <% for product in @products %> I also get similar errors when using the other links on the page. Any idea what is causing this? |
Sam Ruby
197 posts
|
The lines you quoted look like they are from app/views/products/index.html.erb and not from app/views/layouts/products.html.erb By any chance, did some of these lines get added (appended?) to the end of the layout? Check both files against the links provided above. |
Mark McCollum
2 posts
|
You hit it right on the nose. I must have pasted into the wrong file. Thanks! |
3 posts, 2 voices
