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

advertisement

AddThis Social Bookmark Button
Article:
  Rolling with Ruby on Rails
Subject:   Errors in the end
Date:   2005-07-27 12:09:43
From:   acidbox
Response to: Errors in the end

I am also getting a similar error:


RuntimeError in Recipe#edit


Showing /recipe/edit.rhtml where line #20 raised:


Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id


Extracted source (around line #20):


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


23:



Does anyone know what this is or how I can fix it? I thought I had triple-checked my code.


1 to 2 of 2
  1. Errors in the end
    2005-07-27 12:35:22  acidbox [View]

  2. Curt Hibbs photo Errors in the end
    2005-07-27 12:32:34  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

1 to 2 of 2