Rails polymorphic link for nested index action

Viewed 1325

I have been trying to find this one link for hours now. I have a polymorphic association where both collections & assortments have designs.

Collection model

has_many :designs, :as => :targetable

Assortment model

has_many :designs, :as => :targetable

Design model

belongs_to :targetable, :polymorphic => true


In order to link to the design's 'show' action, the proper polymorphic path would be:

link_to polymorphic_path([@targetable, @design])

But I can't figure out how to link to the design's 'index' page to show all the designs associated with it's respective targetable object.

Does anyone know the appropriate link to get there??

1 Answers
Related