我有这个(合同和附件与 has_and_belongs_to_many 相关联):
# Get the contract and specific accessory based on params
@contract = Contract.find(params[:id])
@accessory = @contract.accessories.find(params[:accessory_id])
现在,我想从@contract 中删除该特定附件。我不想从数据库中删除记录,而只是想删除两者之间的关联。
这样做的轨道方式是什么?
谢谢!