Check boxes for a has_many and belongs_to association.
- by Thomas
I have a has_many and belongs_to association.
class Link < ActiveRecord::Base
has_and_belongs_to_many :categories
belongs_to :property
end
class Property < ActiveRecord::Base
has_many :links
end
In the index and show I have <%= link.property.name %> and it will show the Property that I assigned to the link with the console just fine.
I have a problem with figuring out how to show check boxes in the _form that assign a property to the link (a drop down would work as well).
It seems everyone who has had this question before has ether a has_many :through or a HABTM relationship and I can't seem to adapt their answers.