Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

nested_attributes_for belongs_to polymorphic

#2219

I don't know if this is a missing functionality, or there is a trick i couldnt find.

But when i try to create a new belongs_to polymorphic association through a nested form, it off course fails, because there is no build method for it.

Is this functionality wanted as a default (eg. with a :type attribute given), then i'll create a contribute (i'm not so familiar with testing, so i'll need help with that). Or should everyone who needs this functionality make its own build method for polymorphic associations.

Reported by Di Marcello · March 12th, 2009 @ 11:07 AM

State: invalid
Milestone: 2.x
Assigned to: Eloy Duran Eloy Duran
Importance: none

Activity

  1. Eloy Duran
    Eloy Duran
    • Assigned user set to Eloy Duran
    • State changed from new to invalid

    Yeah that's unfortunately not possible with AR atm, see: http://blog.hasmanythrough.com/2...>

    Maybe the plugin that's mentioned in the comments of that article will help: http://blog.evanweaver.com/files...

    Otherwise you'lll just have to define the build method yourself yes.

    March 12th, 2009 @ 01:04 PM