gregbell/active_admin — pull request #2675 by igorbernstein (2013-11-08 06:47:00+00:00)
Title: 2659 nested has many

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:
- tests
- fix up the css (which I could use help with)