In the doc, the only way to interpolate through has_many with child index numbering is to use <generator>.inputs :for => <scope>. However, it doesn't accept blocks, eg. only the most basic solution is supported.
I'd like to give block to .inputs to hand-craft the form, but I'd like to use child index numbering as well. For the first half, I have to use <generator>.semantic_fields_for, but it doesn't set params[:parent] implicitly. However, this setting is a requirement for calling parent_child_index (obviously).
Maybe params[:parent] could be transferred in formbuilder's options somehow to the child scope.
.inputs :for => with block should work. Only to notes:
1) Remember to not use the equal sign (=) in your ERB (<%=) since you are giving a problem;
2) Some people already related issues with haml.
Which one are you using?
Well yes, I'm using haml. Sadly my devel environment (which is in a colinux host) is not accessible when I'm using Cisco VPN, but I'll be able to check it tomorrow.
Hmm I see, .inputs :for => gives a new scope in proc parameter. Is it documented?
Yes, it's documented. If you don't give the new proc scope, an error should be raised.
OK, I tested it, and it was an user error. I haven't noticed any issues with haml, by the way.
After a few hours of play it turned out this is not good for my problem (eg. numbering of sub-forms in a has_many environment).
Thanks for replying! I will close this one, feel free to re-open or open another ticket if you find another issue.