3
我一直在試圖找到這個鏈接幾個小時。我有一個多態協會,其中兩個收藏品&分類都有設計。嵌套索引操作的Rails多態鏈接
收集模型
has_many :designs, :as => :targetable
拼盤模式
has_many :designs, :as => :targetable
設計模型
belongs_to :targetable, :polymorphic => true
爲了鏈接到設計」 S「秀」的動作,適當的多態路徑將是:
link_to polymorphic_path([@targetable, @design])
但我無法弄清楚如何鏈接到設計的「索引」頁面,以顯示與它的各自定位的對象相關聯的所有設計。
有誰知道適當的鏈接?
這是黃金!謝謝! – Tashows