Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses #2659. It allows for nesting of has_many widgets in inputs & other has_many blocks.
The problem that this fixes is that the has_many widget introduces a extra element into Formtastic's fieldset/ol/li hierarchy, which works fine when the has_many is called at the top level, but breaks when its nested in an inputs block. The reason this happens is that formtastic wraps its fieldsets in an li element when it detects that its already in an inputs block. Formtastic's rationale for this behavior is that if we are in an inputs block, then the parent must an ol element, whose children must be lis. However in the case of a has_many, the parent will be a div.
This patch fixes this behavior by pushing the wrapping li element up around the has_many div instead of the has_many's inputs.
TODO: