<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -471,6 +471,7 @@ module ActionView
         options = options.stringify_keys
         name_and_id = options.dup
         add_default_name_and_id(name_and_id)
+        options.delete(&quot;index&quot;)
         options[&quot;for&quot;] ||= name_and_id[&quot;id&quot;]
         content = (text.blank? ? nil : text.to_s) || method_name.humanize
         label_tag(name_and_id[&quot;id&quot;], content, options)</diff>
      <filename>actionpack/lib/action_view/helpers/form_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -540,6 +540,18 @@ class FormHelperTest &lt; ActionView::TestCase
       _erbout
   end
 
+  def test_fields_for_object_with_bracketed_name_and_index
+    _erbout = ''
+    fields_for(&quot;author[post]&quot;, @post, :index =&gt; 1) do |f|
+      _erbout.concat f.label(:title)
+      _erbout.concat f.text_field(:title)
+    end
+
+    assert_dom_equal &quot;&lt;label for=\&quot;author_post_1_title\&quot;&gt;Title&lt;/label&gt;&quot; +
+      &quot;&lt;input name='author[post][1][title]' size='30' type='text' id='author_post_1_title' value='Hello World' /&gt;&quot;,
+      _erbout
+  end
+
   def test_form_builder_does_not_have_form_for_method
     assert ! ActionView::Helpers::FormBuilder.instance_methods.include?('form_for')
   end</diff>
      <filename>actionpack/test/template/form_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>96d9691e71319f4c166315a36b96c2c3c54ed493</id>
    </parent>
  </parents>
  <author>
    <name>Kevin Glowacz</name>
    <email>glowacz@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/c83f75812ef89aea1b8d138aebec25de8057f156</url>
  <id>c83f75812ef89aea1b8d138aebec25de8057f156</id>
  <committed-date>2008-04-30T15:21:18-07:00</committed-date>
  <authored-date>2008-04-30T15:21:18-07:00</authored-date>
  <message>Fixed labels that have a bracketed name and an index [#68 state:resolved]

Signed-off-by: Joshua Peek &lt;josh@joshpeek.com&gt;</message>
  <tree>b44d83fb5da25ea8b833037d6e074adb3bff8759</tree>
  <committer>
    <name>Joshua Peek</name>
    <email>josh@joshpeek.com</email>
  </committer>
</commit>
