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:
https://github.com/plataformatec/simple_form/issues/closed#issue/181

There is also an example app showing the issue in my github:
https://github.com/carlosantoniodasilva/simple_form_foobar

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages