Forum: Ruby on Rails undefined method `name' for #<Category:0x3820f70>

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1744718eb0f1f4c8ec88d8560ad2409c?d=identicon&s=25 Lurlay, Patrick (Guest)
on 2006-04-28 22:43
(Received via mailing list)
  I am having a bit of trouble with the error. I hava a product and
category table and wanting to display the categories in a drop down
list.  Below is the error I get. Any suggestion on how I can fix this.

undefined method `name' for #<Category:0x3652448>

9:     <select name="product[category_id]">
10:       <% @categories.each do |category| %>
11:       <option value="<%= %>">
12:         <%= %>
13:       </option>
14:       <% end %>
15:     </select>


89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-04-28 22:49
(Received via mailing list)
This may sound silly, but do you have a field named name in your
category table?
This topic is locked and can not be replied to.