This project is archived and is in readonly mode.

#181 ✓duplicate
David Röthlisberger

Incorrect input name with nested fields_for

Reported by David Röthlisberger | May 13th, 2008 @ 04:36 PM | in 2.x

form_for('post[]', @post) do |f|
  f.fields_for('comment[]', @comment) do |c|
    c.text_field(:name)
  end
end

I expect:

<input name="post[123][comment][][name]" .../>

Instead I get:

<input name="post[][comment[]][name]" .../>

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>

People watching this ticket

Attachments

Tags

Pages