PDA

View Full Version : new ruby on rails programer issue


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

steve_d555
October 16th, 2005, 04:36 PM
Usually that means that your database is not right. Check it and make sure it is exactly like ORielly's and then try again.