| Article: |
Rolling with Ruby on Rails | |
| Subject: | Errors in the end | |
| Date: | 2005-07-08 07:46:22 | |
| From: | curth | |
|
Response to: Errors in the end
|
||
| This looks like the same problem that Peter just resolved above in the post "Couldn't find Recipe without an ID". Please try his solution. | ||
Showing messages 1 through 6 of 6.
-
Errors in the end
2005-07-08 12:26:24 PGomez [View]
I tried it and still getting the same issue and same errors. I am sorry to be posting this, but still learning and not familiar enough to get this one going. -
Errors in the end
2005-07-08 14:35:26 Curt Hibbs |
[View]
Make sure that every recipe in your database has an assigned category.
Also, near the beginning og part 2 of this article, there is a link to the source code for a working version of part 1 (hopefully it still works since Rails 0.13 was just released). Anyway, you can download my sourcecode and see if that works, and then compare it with what youhave. -
Errors in the end
2005-07-15 12:55:06 zsmirnoff [View]
the column id must be in lowercase - id - not Id, as mysql defines it first, in the database - just change the column name; rails use a lot of concepts about naming
-
Errors in the end
2005-07-08 13:24:40 PGomez [View]
To get past the list.rhtml page, I omitted the line 18 that states
<td><%= recipe.category.name %></td>
Now it enables me to see the page, but still is not doing me any good since it did not solve the problem. With that, on the edit.rhtml I changed line 24 to:
<%= 'selected' if category.id == @recipe.category_id %>>
Instead of:
<%= 'selected' if category.id == @recipe.category.id %>>
Does that make sense with that second change? Thanks! -
Errors in the end
2005-10-21 08:41:49 kFuQ [View]
To get past the list.rhtml page, I omitted the line 18 that states
<td><%= recipe.category.name %></td>
chg to
<td><%= recipe.category name %></td> -
Errors in the end
2006-10-04 05:02:32 rudyOnTheTrain [View]
@recipe.category_id points to the foreign_key in the table recipe called category_id,so it makes perfect sense. @recipe.category.id points to a column that doesn`t exist in the table recipe.


