ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Rolling with Ruby on Rails, Part 2
Subject:   Error?
Date:   2005-05-13 21:31:07
From:   boboroshi
Utilizing your new code download (which works) and following the first two steps, i run into this error after the category application:


NoMethodError in Recipe#new


Showing /recipe/new.rhtml where line #19 raised:


undefined method `each' for nil:NilClass
Extracted source (around line #19):


16:


17: Category:<br/>
18: <select name="recipe[category_id]">
19: <% @categories.each do |category| %>
20: <option value="<%= category.id %>">
21: <%= category.name %>
22: </option>


1 to 3 of 3
1 to 3 of 3