This method is returning empty:
<% f.fields_for :asset do |as| %> # not work with or without "="
<%= as.label :name %><br />
<%= as.text_area :name %>
<% end %>
I wrote an answer here: http://stackoverflow.com/questions/6086120/helper-fields-for-not-working
So I created a minimal app for test but error still.
I think it's a bug.
Could you provide this failing app ? Or even better, a failing test !
Here is my test app with log and all included: https://github.com/edison/rails-test-helper-error
You shouldn't name your model Asset. When renaming it to something else, it works well.
Edit : my bad. It occurs whenever the relation has accepts_nested_attributes_for.
In my main app this model is called Traditions::MaterialAsset, doesn't work too.
Quite certain this is not a bug.
I posted an answer to your stack overflow question. I tested it with your app an it solves the problem - you don't appear to be calling build_asset (or build_material_asset) on the parent object.
@thetron is right, it works. Thx!
As @thetron said it's because the association is empty and is defined as accepting nested attributes. See this article for more information: http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes, specifically the section called 'Default Create Form Fields'