Undefined method `category_id'

3:
4: Category:
5:
6: <%= options_from_collection_for_select @categories, “id”,
“category”, @product.category_id %>
7:
8:


9:

Lurlay, Patrick wrote:

3:
4: Category:
5:
6: <%= options_from_collection_for_select @categories, “id”,
“category”, @product.category_id %>
7:
8:


9:

Try @product.category.

-Adam

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs