RailsCasts Pro episodes are now free!

Learn more or hide this

Erik Straub's Profile

GitHub User: brickattack

Site: http://fiveeighteen.net

Comments by Erik Straub


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 for the callback, it works.