【发布时间】:2013-12-17 01:23:47
【问题描述】:
我已经尝试找到这个链接几个小时了。我有一个多态关联,其中集合和分类都有设计。
集合模型
has_many :designs, :as => :targetable
分类模型
has_many :designs, :as => :targetable
设计模型
belongs_to :targetable, :polymorphic => true
为了链接到设计的“展示”动作,正确的多态路径应该是:
link_to polymorphic_path([@targetable, @design])
但我不知道如何链接到设计的“索引”页面以显示与其各自的可定位对象相关联的所有设计。
有人知道到达那里的适当链接吗??
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 nested-attributes polymorphic-associations