This project is archived and is in readonly mode.
nested fields_for with index should account for the index
-
Kevin Glowacz
new patch with modified regex that works a lil better for me.
-
Kevin Glowacz
- Tag set to actionpack, patch, tested
updating tests to work with rails edge and the _erbout to output_buffer change
-
Kevin Glowacz
the updated patch for real this time
-
RSL
Kevin, how does this handle nested fields_for with indexes on each fields_for? Don't have time to test myself.
-
RSL
I do like this though. Just making sure it doesn't clash now that our other patch was committed.
-
Kevin Glowacz
This does work with indexes on the nested fields for. (It is actually what I use this for.)
form_for(:post, @post, :index => 1) do |f| f.fields_for(:comment, @post, :index => 5) do |c| concat c.text_field(:title) end endproduces
<form action="http://www.example.com" method="post"> <input name="post[1][comment][5][title]" size="30" type="text" id="post_1_comment_5_title" value="Hello World" /> </form> -
RSL
Was that in the test coverage? I musta missed in reading quickly.
-
Kevin Glowacz
no it isn't in the patch. I just assumed it would be assumed that everything else continued to work. I suppose I should add it in.
-
RSL
I guess I'm used to assuming nothing works without a test. [That wasn't meant to sound as TDDier-than-thou as it might].
-
Kevin Glowacz
well those tests only showed the exact behaviour that changed, but no one ever complains about test being to explicit. More tests are on the way.
-
Kevin Glowacz
s/to/too
-
Kevin Glowacz
It is a good thing you had me write those tests. I discovered that nested auto_index didn't work. Now it does along with more tests to cover that the inner fields_for having index and auto index work.
-
Kevin Glowacz
updating patch to apply cleanly to edge. I think the only difference is in the hashes and line numbers, but I get an error with the old patch for some reason.
And apparently I can't delete my old attachments anymore.
-
RSL
+1 here.
-
Pratik
- Assigned user set to josh
-
Repository
- State changed from new to resolved
(from [1b4b1aa725a4f44c3473ae99b36d7cededba2bea]) Fixed index and auto index for nested fields_for [#327 state:resolved]
Signed-off-by: Joshua Peek
-
Ryan Bigg
Automatic cleanup of spam.
-
Ryan Bigg
Automatic cleanup of spam.
