0
我有兩個模型Post
和PostCategory
兩者都有has_and_belongs_to_many
關係。附加模型has_and_belongs_to_many關係在軌道上
我已經手動創建了三個post_categories
:news
,don't miss
和announcements
。
當我創建一個新的post
我希望能夠選擇在categories
它belongs to
通過select
與multiple="true"
。
注意:我不想對post
創建創建一個新的category
但要附加一個或多個categories
這個post
!
致謝 「4.4.1.8 collection_singular_ids」 部分看一看!解決了我的問題,並向我清楚:) – jimzarkadas