szimek
2009-Sep-24 20:48 UTC
Should fields_for for has_many association execute block even if the collection is empty?
Hi, I had a problem where fields_for block was executed once, even if the association collection was empty - child_form.object was nil of course. Adding accepts_nested_attributes to parent model solved the problem - block is now executed correctly for each instance of the collection. Is this proper behavior or a bug? I''m using Rails 2.3.4 Cheers, Szymek