I have the following association in my Rails app:
Order has_and_belongs_to_many Type
Type has_and_belongs_to_many Order
There is a join table called OrdersTypes.
I know I can do Order.create(:types => [Type.first])
.
However, if I am designing an API and I want the User to be able to create an order with just a Type id, how would the parameters look?
Something like Order.create(:type_ids => [1,2,3,4])