1
所以我的地址模型有一個:id
字段和一個:person_id
字段。重定向到破壞行爲中的參數
我破壞功能如下
def destroy
@addresses = Address.find(params[:id])
@addresses.destroy
redirect_to _______
end
我如何重定向回:person_id
如果這有助於更好地解釋它的 URL被作爲跟隨
/人/ 1111111
然後我刪除它到地址ID
/地址/ 212212 /刪除
然後我需要回到人物ID
重定向到/人/ 1111111