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
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)
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
3 matches
Mail list logo