#291 open
Clemens Kofler

ExtensibleFormBuilder with nested attributes

Reported by Clemens Kofler | April 29th, 2009 @ 11:35 AM

ExtensibleFormBuilder behaves weird when used with nested attributes (accept_nested_attributes_for :whatever):

<% f.fields_for(:nested_objects, object) do |ef| -%>

Assuming that object's class is Person, this tries to look up Person[nestedObjectsAttributes][0] and if not found tries to set a constant which results in an error being thrown because it's not a valid constant name.

Looking at the caller stack it seems like Rails somewhere injects its call to fields_for_with_nested_attributes before ExtensibleFormBuilder's own alias_method_chain:

["/path/to/project/vendor/plugins/adva_cms/lib/extensible_forms.rb:8:in `fields_for_nested_model'", "/path/to/project/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:1010:in `fields_for_with_nested_attributes'", ...]

In the meantime, one can fix this by manually passing the default form builder via the :builder option but this should be investigated.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>

<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>

<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>