RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: brickattack
Nested forms for polymorphic associations are messy.
If the relationship wasn't polymorphic, you could do inverse_of on each model so that the code knew the relationship of the objects in memory. http://guides.rubyonrails.org/association_basics.html#bi-directional-associations
I ran into this issue and did a sort-of hack to avoid validation errors in a nested polymorphic form: https://gist.github.com/1936811
^^ If you just use 127.0.0.1:3000 for the callback, it works.