# polymorphic\_url for index

**URL:** <https://discuss.rubyonrails.org/t/polymorphic-url-for-index/36367>\
**Category:** rubyonrails-talk\
**Created:** [November 14, 2008, 4:36pm UTC](https://discuss.rubyonrails.org/t/polymorphic-url-for-index/36367 "2008-11-14T16:36:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [November 14, 2008, 4:36pm UTC](https://discuss.rubyonrails.org/t/polymorphic-url-for-index/36367/1 "2008-11-14T16:36:46Z")

</div>

Perhaps I should be more specific:

I'm using STI (single table inheritance) and I'm displaying the objects using the same view. I need to put a link to the index. polymorphic\_url helped me so far, because it generates the new, create, update and edit URLs depending on the object type, but there seems to be no easy way to generate the index URL.

Gabi Ge wrote:

---

<div class="post-metadata">

**Author:** ![Glenn4](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@Glenn4](https://discuss.rubyonrails.org/u/Glenn4)\
**Post date:** [December 3, 2008, 5:31pm UTC](https://discuss.rubyonrails.org/t/polymorphic-url-for-index/36367/2 "2008-12-03T17:31:14Z")

</div>

Try:

polymorphic\_url([@parent, ChildClass.new])

If the array contains an item which is new (not saved), then it uses the plural form of path (index).
