This project is archived and is in readonly mode.
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
-
Carlos Antonio da Silva February 8th, 2011 @ 03:16 AM
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.
-
Carlos Antonio da Silva February 8th, 2011 @ 04:48 PM
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... -
Repository February 8th, 2011 @ 08:05 PM
- State changed from new to committed
(from [ee0b92ec7a87967c55fa2992350b12493d3c148b]) fields_for with inline blocks and nested attributes already persisted does not render properly
[#6381 state:committed] https://github.com/rails/rails/commit/ee0b92ec7a87967c55fa2992350b1...
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>
People watching this ticket
Referenced by
- 6381 fields_for with inline blocks and nested attributes already persisted does not render properly [#6381 state:committed] https://github.com/rails/rails/c...