ActiveAdmin performance optimizations for Rails apps

ActiveAdmin performance optimizations for Rails apps
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

We try to describe less obvious tips and techniques for Rails apps in our blog, so this time we are presenting you ActiveAdmin performance optimization for Rails apps.

ActiveAdmin gem is a popular tool for building admin interfaces in Ruby on Rails apps.

Here come the tips:

  • Add query persistence to filters. One issue with default implementation is that the search query is not persistent. Every time you click away to a different page, you need to do a new search from scratch.

  • Normalize blank attributes. ActiveAdmin uses Formtastic under the hood. There is a known issue with blank values populating your models after submitting a form with empty fields.

  • Watch out for slow filters. The problem is that ActiveAdmin creates a select filter for all the has_many relation on a model. So if a user has_many posts, /admin/users view will display select box, rendering data of ALL the posts present in the database.

  • Use custom form views. You need to start by declaring a batch action that renders a view and another one that receives params submitted from the form.

Interested? Find more tips here.

P.S. While using Rails app, remember what can cause Rails apps outages.

And find more Rails tips in our video screencasts!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111