ActiveAdmin: add a button toggle the sidebar’s visibility to save real restate

What

Emanuele Tozzato
1 min readMay 26, 2018

Clients of PharmWare have been suffering from lack of real estate for some resources that require displaying plenty of columns. Because of tabs allowing access to very specific scopes, filters are not used so much that they need to always be showing. This was a very low-hanging fruit!

Ingredients

Ruby on Rails (5.2) ActiveAdmin (2.0.0.alpha)

Idea

Append a button after action_items that will toggle the sidebar’s visibility. On page load, we are not hiding the sidebar if filters are in use.

A bit of JS and a tiny bit of css

That’s all I wanted to annotate today.

--

--

Emanuele Tozzato

Artisan+Brain of 42⁺0 Technologies, purveyor of PharmWare, the finest PAAS LIMS for cannabis testing labs. Intrepid family man and elitist pizza cognizant.