gregbell/active_admin — pull request #2645 by seanlinsley (2013-11-02 22:14:31+00:00)
Title: Refactor the has_many form

First and foremost, this PR moves the JS `onclick` calls out into their own dedicated file. This also adds before & after hooks so you can more easily update dynamic parts of the form, for example if you're using a plugin like Chosen for interactive dropdowns:

```coffee
$ ->
$('a.button.has_many_add').on 'has_many_add:after', ->
$(@).siblings('fieldset:last').find('select').chosen()
```

There's one other change here: I switched around the text used for has_many deletion because it didn't make sense to me that delete was applied to something that hadn't yet been saved, while remove was used for saved records.