This project is archived and is in readonly mode.

#6381 ✓committed
Carlos Antonio da Silva

fields_for with inline blocks and nested attributes already persisted does not render properly

Reported by Carlos Antonio da Silva | February 6th, 2011 @ 09:49 PM

When using nested attributes and editing a record, the fields_for block does not render properly.

This does not work:

<%= f.fields_for(:addresses) { |builder| render 'addresses/fields', :f => builder  } %>

This works:

<%= f.fields_for(:addresses) do |builder|  %>
  <%= render 'addresses/fields', :f => builder %>
<% end %>

There is a detailed explanation of this issue in SimpleForm issue tracker:

There is also an example app showing the issue in my github:

Tested on both master and 3.0.3 stable version.

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

Referenced by