Replace `CGI.escapeHTML` with `template.h`

Fixes https://github.com/activeadmin/activeadmin/issues/3430
This isn't what the PR title says it is. Also, the tests are failing on Rails 3.2