[Rails] Re: polymorphic_url

2012-09-03 Thread John Merlino
Oh, I figured this one out. Reason why the else doesn't pop the last element is because the last element is the object passed to form_for that has been persisted, and that element is needed in the array for the id value when we invoke send on the dynamic route generated. On Sep 3, 2:57 pm, John Me

[Rails] Re: polymorphic_url for index

2008-12-03 Thread glennpow
Try: polymorphic_url([EMAIL PROTECTED], ChildClass.new]) If the array contains an item which is new (not saved), then it uses the plural form of path (index). On Nov 14, 8:36 am, Gabi Ge <[EMAIL PROTECTED]> wrote: > Perhaps I should be more specific: > > I'm using STI (single table inheritance)

[Rails] Re: polymorphic_url for index

2008-11-14 Thread Gabi Ge
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 the