| Article: |
Rolling with Ruby on Rails | |
| Subject: | Action Control:Exception caught | |
| Date: | 2006-03-30 07:53:04 | |
| From: | doori | |
|
I am a new Ruby User and started working with it previously. As I tried to finish the first tutorial I caught this exception: You have a nil object when you didn't expect it!
|
||
Showing messages 1 through 1 of 1.
-
Action Control:Exception caught
2006-03-30 07:58:35 Curt Hibbs |
[View]
The recipe you are trying to display probably does not have a category assigned to it -- check your database. If the category_id field is null, then "recipe.category" will return the value "nil" instead of a category object, and since the "nil" object doesn't have a "name" method, you get this error.


