justinfrench/formtastic — pull request #798 by mhuggins (2012-02-12 19:15:01+00:00)
Title: Pass current label as arguments to inputs block for nested inputs

This is to fix issue #771. I previously submitted pull request #773, which had failing tests for older Rails versions. This not only addresses that, but is also a better solution I believe.

Now, when calling `inputs` on a form builder when passing a block, the second argument provided is the nested attribute index. e.g.:

<%= form.inputs :for => :tags do |tag, index| %>
<%= tag.input :label => "Tag #{index}" %>
<% end %>

See the updated README in this pull request for another (better) example.