This will cause the html to be double escaped (which I'm guessing is reason why you added a manual unescape_html function

https://github.com/seanlinsley/active_admin/blob/991cb803d2f822be373bb2e2e0cccdc05295b4a5/app/assets/javascripts/active_admin/components/has_many.js.coffee#L1

The reason that happens is because:
- with_new_form_buffer returns unescaped html thats marked as html_safe
- CGI.escapeHTML returns escaped html thats __not__ marked html_safe
- link_to ... {data: html} re-escape the html because its not marked save

the most succinct way to accomplish what you want is to taint the return value from with_new_form_buffer:
```ruby 
'' + with_new_form_buffer {... }
```
but to be clearer:
```ruby
html = CGI.escapeHTML(...).html_safe
```