Rails 3 has_and_belongs_to_many creates checkboxes in view
问题 Based on following models class Company < ActiveRecord::Base has_and_belongs_to_many :origins end class Origin < ActiveRecord::Base has_and_belongs_to_many :companies end I want to have in my companies/_form a collection of checkboxes representing all origins. Don't know if the Company.new(params[:company]) in companies_controller#create can create the association between company and the selected origins? I'm running rails 3.0.0, what is the best way to achieve that? thanks for your insights