Forum: Ruby on Rails undefined method `category_id'

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Lurlay, Patrick (Guest)
on 2006-04-29 04:28
(Received via mailing list)
3:
4:   <b>Category: </b>
5:       <select id="item_category_id" name="item[category_id]">
6:         <%= options_from_collection_for_select @categories, "id",
"category", @product.category_id %>
7:       </select>
8:   </p>
9:
Adam B. (Guest)
on 2006-04-29 11:07
Lurlay, Patrick wrote:
> 3:
> 4:   <b>Category: </b>
> 5:       <select id="item_category_id" name="item[category_id]">
> 6:         <%= options_from_collection_for_select @categories, "id",
> "category", @product.category_id %>
> 7:       </select>
> 8:   </p>
> 9:

Try @product.category.

-Adam
This topic is locked and can not be replied to.