Frosty1
October 16th, 2005, 04:09 PM
i am just looking at ruby on rails as a alternative for my apps. i am working on a tutorial from orielly, but running into a few issues. i wonder if these are changes between the versions.
this is the code:
<% @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 %>
the recipe.category.name is throwing an error
undefined method `name' for nil:NilClass
i am using rails 0.13.1
this tutorial was written in 0.9.3
any thoughts would be great
this is the code:
<% @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 %>
the recipe.category.name is throwing an error
undefined method `name' for nil:NilClass
i am using rails 0.13.1
this tutorial was written in 0.9.3
any thoughts would be great