Rolling Your Own Data
A limitation of the ActiveAdmin data setup is that it allows only one CSV definition per class, and that class needs to already be something ActiveAdmin is handling. You’re likely going to want multiple windows on the data, and CSV representations of data that isn’t quite a database table.
The ActiveAdmin DSL for CSVs is nice, though, and it’d be valuable to be able to appropriate it. Turns out that, while the ActiveAdmin::CSVBuilder is not a lot of code, it’s somewhat tightly coupled to ActiveAdmin and Rails controllers and views, and is a little more abstract than we need it to be.
So, I took the liberty of pulling out the CSV builder code and adapting it to be a lot more generic. First, I removed a few references to ...
Get Take My Money now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.