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.
In this example, you have a Baz that when it’s saved, you want to make sure that it has the current foobar available for the before_save and validation callbacks.
In your model, you have your attr_accessor defined:
And then in your ActiveAdmin controller:
1 2 3 4 5 6 7 8 9 10 11
And whatever you’ve put in that attr_accessor is available for whatever callbacks and validations you might need it for.