O'Reilly logo

Take My Money by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required