This project is archived and is in readonly mode.
nested_attributes_for belongs_to polymorphic
Reported by Di Marcello | March 12th, 2009 @ 11:07 AM | in 2.x
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.
Comments and changes to this ticket
-
Eloy Duran March 12th, 2009 @ 01:04 PM
- 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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>