gregbell/active_admin — pull request #2071 by shekibobo (2013-04-07 22:10:29+00:00)
Title: Add :allow_destroy option to has_many forms

This option will add a boolean field "Remove" to the
end of each `has_many` fieldset that is an existing
record. This provides a workaround for issue #1990,
and allows for cleaner form coding.

Instead of the following, which would not work because
of the issue mentioned above:

```ruby
form do |f|
f.inputs do
f.has_many :children do |child_f|
child_f.input :name
child_f.input :_destroy, :as => :boolean, :label => "Remove", :wrapper_html => {:class => 'has_many_remove'} unless child_f.object.new_record?
end
end
end
```

we could simply write:

```ruby
form do |f|
f.inputs do
f.has_many :children, :allow_destroy => true do |child_f|
child_f.input :name
end
end
end
```