I have products belonging to collections. A collection is just a name. Products have a collection_id.
In my _form view that is used for creation and edition of produ
You can use a collection select, first make sure your models are properly setup:
class Product
belongs_to :collection
end
class Collection
has_many :products
end
Then add the collection select to your view:
<%= collection_select(:product, :collection_id, Collection.all, :id, :name) %>
You can also read up on the documentation here.