Activeadmin

Unescaping HTML on ActiveAdmin Pages

By default, an ActiveAdmin page, either show or index, will escape any HTML in a field that it displays. This is generally good behavior, but if you have an HTML field that’s supposed to have HTML in it, it will be displayed fully escaped, with the < and > tags mucking things up in all their glory. If you have a field that’s supposed to have HTML in it and you take care of cleaning and sanitizing it already (like on save), you can get around this feature like so.

Bending ActiveAdmin To My Will With a Customized Update Action

We had a situation where we wanted to customize ActiveAdmin’s update action to behave a little differently. We needed to have the update event set an attr_accessor that was necessary for some before_save hooks, and the instructions on the Internet on how to do override the ActiveAdmin actions didn’t cover that case. The solution was painful to figure out and involved a lot diving through ActiveAdmin, InheritedResources, and Formtasic, but the solution turned out to be fairly straightforward.