| Article: |
Rolling with Ruby on Rails | |
| Subject: | NoMethodError in Recipe#list | |
| Date: | 2006-12-11 20:16:22 | |
| From: | jshphoto | |
|
Ok, I thanks to the previous post, I was able to succesfully define the "id" field in my recipe table. I was then able to create categories on the category/list page. However, when I tried to update the recipes I had created with the categories, the category drop down menu was not there. I tried rewriting my html in my rails\cookbook\app\views\recipe\list.rhtm file and my c:\rails\cookbook\app\views\recipe and I now get the following error
|
||
Showing messages 1 through 1 of 1.
-
NoMethodError in Recipe#list
2006-12-11 20:26:59 jshphoto [View]



Extracted source (around line #1):
1: <html>
<head>
<title>All Recipes</title>
</head>
<body>
<h1>Online Cookbook - All Recipes</h1>
<table border="1">
<tr>
<td width="40%">
Recipe</td>
<td width="20%">
Category</td>
<td width="20%">
Date</td>
</tr>
<% @recipes.each do |recipe| %>
<tr>
<td><%= link_to recipe.title, :action => "show", :id => recipe.id %></td>
<td><%= recipe.category.name %></td>
<td><%= recipe.date %></td>
</tr>
<% end %>
</table>
<%= link_to "Create new recipe", :action => "new" %>
</body>
</html>
RAILS_ROOT: /Users/jameshouser/Sites/cookbook3/public/../config/..