My has_and_belongs_to_many doesnt work in my show view, In the form i am able to select multiple options but they wont display in the show.html.erb
My Section Controller
class Section < ActiveRecord::Base
attr_accessible :about, :name
has_and_belongs_to_many :products
end
My Products Controller
class Products < ActiveRecord::Base
attr_accessible :price, :name, :section_id
has_and_belongs_to_many :sections
end
In my show view
<%=h @product.section.name %>
How do I display all chosen section when creating and showing a product