Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#6381

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.

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

State: committed
Milestone: none
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: none

Activity

  1. Carlos Antonio da Silva
    Carlos Antonio da Silva

    Santiago, I wrote some tests showing the issue related to inline blocks only, but working with multiline blocks and erb: https://github.com/carlosantoniodasilva/rails/commit/62fee09ecdcdfd...

    Please let me know if you have any doubt.

    February 8th, 2011 @ 03:16 AM

  2. Carlos Antonio da Silva
    Carlos Antonio da Silva

    Sorry, I forgot to say these tests were for the branch 3-0-stable.
    Here are the tests for the master branch: https://github.com/carlosantoniodasilva/rails/commit/662047dd14b57e...

    February 8th, 2011 @ 04:48 PM

  3. Repository
    Repository
    • State changed from new to committed

    February 8th, 2011 @ 08:05 PM