Model1
attr_accessible :model2s, :model2_ids
has_many :model2s
Model2
belongs_to :Model1
1. Have a model with attr_accessible :model2_ids
2. f.collection_select :model2_ids , Model2.all, :id, :name, {},{:multiple=>true,:size=>5}
The trick is "model2_ids"
Thats it !
attr_accessible :model2s, :model2_ids
has_many :model2s
Model2
belongs_to :Model1
1. Have a model with attr_accessible :model2_ids
2. f.collection_select :model2_ids , Model2.all, :id, :name, {},{:multiple=>true,:size=>5}
The trick is "model2_ids"
Thats it !