activeadmin-rails

Ten years ago I was a relatively inexperienced Rails consultant hired to accelerate custom development at a rapidly growing e-commerce startup.  A major overhaul was desired for the backend systems using an extensive RDBMS schema and I wanted feedback with a rapid prototype, so I reached for a framework presented at 2011 RailsConf called ActiveAdmin.

Ultimately the overhaul was a success and I was hired to manage maintenance, where I have dug into ActiveAdmin’s features to learn customization, and shared what I learned on the wiki and StackOverflow.  The primary author, Greg Bell, moved on to grander things long ago but others, briefly including myself, stepped up to continue maintenance of the gem from Rails 3 through the present.

In some ways ActiveAdmin in 2011 was ahead of its time, the UI built from the ground up using HTML views in Ruby extracted as Arbre (similar to Markaby, Erector, Fortitude and now Phlex).  For better or worse this approach  failed to make in-roads against Erubi and Haml/Slim templates, then a few years ago ES6 revitalized front-end development and gave rise to React, threatening to delegate Rails to an API only framework.  Fortunately Rails has now evolved with Hotwire and Stimulus, and GitHub has pioneered a new Rails compatible framework called ViewComponent.

In other ways ActiveAdmin in 2011 was a product of its time, leaning heavily on Ruby meta-programming to build an extensive configuration DSL.  While impressive in some respects it also adds to the learning curve for both advanced customization and trouble shooting.  Since then mainstream Ruby development has swung back to a more object oriented approach emphasizing inheritance and composition: Administrate exemplified this trend and was a real eye opener to me when it was announced.

Where does that leave ActiveAdmin in 2023?  Many have already moved on to the likes of react-admin, but in my opinion Rails 7 is time for a significant overhaul, and this fork is my effort to offer an alternative with a clear migration path.

Year Thirteen with Rails

These last twelve months have been the first without a major or minor Rails release, though there have been multiple bug-fix patches to 7.0. Ruby 3.2 included production ready YJIT and better ReDoS protection. InfoWorld published ‘Whatever happened to Ruby?’ However, the biggest buzz has been figuring out how to use ChatGPT productively: a much easier task with greenfield projects I think.

At my employer the focus has been on Google Ads, fraud detection and logistics improvements.
Nonetheless ‘maintenance mode’ still includes an unending flow of diverse fixes and refinements such as unearthing race conditions and fixing transaction boundaries. 3DS v1 was sunset, AWS abandoned Data Pipeline, and we explored Terraform. Apollo GraphQL has been retired as REST based alternatives are holding up good enough.

New gems used this year included `validates_email_format_of` and integrations with Braintree and AfterShip.

On StackOverflow I drifted into the ‘activeadmin’ tag top 15

For better or worse my only open source contributions have been to my own evolving fork of ActiveAdmin: using a different rendering strategy for Arbre, embracing Rails layouts, slashing controller meta-programming, and reducing dependency on the resource DSL.

Year Twelve with Rails

This last year has seen the release of Ruby 3.1 and Rails 7.0 with its exclusive use of Zeitwerk and shift away from Node and Webpacker to Hotwire. React, Webpacker, Yarn and Jest are still used widely with Rails but Stimulus adoption has been significant.

At my employer European PSD2 has continued to require significant attention with a rewrite of Redsys payment integration using REST and the addition of Cardinal Cruise. We have also refined shipping method selection and handling of stock-outs.

New gems used this year included Gala for ApplePay. Open source contributions included replacing the Resque web-runner by merging the abandoned Vegas gem.

Year Eleven with Rails

Five years after our adoption of React on Rails this year has seen the release of Stimulus-Reflex and the refinement and extension of Turbolinks and Stimulus into Hotwire, a welcome, mostly server side alternative.  So far we have only explored Frames for faster TTFB but we’re optimistic about wider applications.  Also notable this year Rails 6.1 shipped with built in support for ViewComponents, though we are yet to complete our upgrade or move from Ruby 2.7 to 3.0.
At my employer our modular monolith architecture remains unchanged. Interestingly Shopify published a nuanced engineering article concluding “all large architecture changes end up in an incomplete state”.  Apart from European PSD2 mandates, a new billing strategy and greater Facebook marketing API integration, our focus has been on improved change logging and auditing, and tidying and extending test data factories, VCR cassettes, interactor, job, request and feature  specs.  Along the way we refactored offer management, logistics exports, PayPal Express Checkout and fraud detection.  For the first time this year no new gem dependencies were introduced, though we forked PayPal’s REST SDK, abandoned by PayPal.
After years answering 160+ ActiveAdmin questions on StackOverflow I reached the top 20 contributor list and earned StackOverflow’s ‘activeadmin’ badge… time to retire, I think.

Nine Years A Rubyist

This last year has seen continuing maturation of Ruby on Rails with Ruby 2.6 and Rails 6.0. Ruby 2.6 included an initial release of JIT compilation for YARV, and Rails 6.0 adopts Webpacker as the default JavaScript asset manager instead of Sprockets. Ruby, however, continues increasingly overshadowed by JavaScript and Python, and Rails is challenged by the popularity of microservices and Node. Neither Matz’s mruby 2.0 nor Crystal have gained widespread attention, but at least AWS Lambda Ruby support and FaastRuby are now available.

At a practical level, for our mature in-house codebase a switch to microservices is not necessary or cost effective. This year, however, has seen Stephan Hagemann’s ‘Component Based Rails Applications’ ebook published (endorsed) as a softback by Addison Wesley and a very similar approach embraced by Shopify. Our own internal codebase remains ~60% gemified from 2017 in a simple layered architecture while we have focused on consistently packaging business logic using interactors (service objects) for both foreground and background processes.

New gems (to us) used this year included roxml, and replacing the unmaintained god process monitor with eye. On the open source side I stepped back from contributing to ActiveAdmin and published instead a couple of API clients for AmEx and PayPal.

Eight Years A Rubyist

Year 8 with Rails for me has been an unglamorous affair of maintenance upgrades (Ruby 2.3, Rails 5.x), refactors and bug fixes.

It has been discouraging to see StackOverflow characterize Ruby as shrinking and unpopular and compare Ruby on Rails with ASP.net. Nate Berkopec’s findings that vanilla Rails apps are perfectly capable of 1,000 requests/minute is cold comfort in the face of shrinking developer mindshare: this decline has real consequences in terms of open source contributions and Ruby gem maintenance.

On the other hand Ruby remains #4 on Github and developers are still very much in demand. JavaScript continues ascendant but Derek Prior of Thoughtbot has mentioned cooling enthusiasm for Elixir, and Go too has slid in popularity, at least according to TIOBE. Crystal 1.0 remains delayed. An experimental JIT has now shipped for YARV foreshadowing further performance improvements in Ruby 2.6.

On the Rails front end Basecamp continued their contrarian tradition by offering Stimulus.js as a more limited and pragmatic alternative to React’s dominant framework. The Majestic Monolith remains relevant for smaller businesses and early stage startups despite ambitious engineers everywhere (myself included) wanting to use the same tech stack as the largest, most successful companies from Apple, Salesforce and Netflix to… Twitter. At Railsconf GitHub, now owned my Microsoft, recommitted to easier scalability enhancements for Rails 6.

On the infrastructure side the Docker ecosystem has continued to mature with the embrace of Kubenetes at Dockercon EU in Oct ’17. It has also been good to see a more enlightened approach to open source by AWS with EKS and ApacheMQ.

At my employer we continue to support a somewhat modular monolith with a 50 kloc monorepo, 40 ActiveAdmin resources, 60 background jobs, 70 direct and 240 total gem dependencies. We have fully caught up with Rails 5.2 and edged forward with Ruby 2.3 for Bootsnap support and React-Apollo 1.x. Procedural code has continued to migrate to standardized Interactors. New gems used included Bootsnap, Combustion, Dalli (memcached) and AWS SDK v3 SQS, S3, SES & SNS.

What has Rails 5.x brought us? More secure controller parameters, still scarily subvertible by less experienced developers, but at least awareness has been raised. More restricted autoloading, for the best. Better callback management, though we try to avoid them as much as possible. Bootsnap with a significant improvement in startup times, yay!

Open source contributions this year have included a couple of minor ActiveAdmin releases including Rails 5.2 support and various PRs for the AuthorizeNet Ruby SDK.

AWS features I have been working more with this year have included ClassicLink, private subnets, piculet, Data Pipeline and managed SSL certs. Concerns over production container management have been mitigated with a mass of metrics collection with CloudWatch, Librato and Skylight.

What will the next year bring? A pragmatically managed evolution towards ‘mini-services’, Rails 6 with polished multi-database support, Ruby 2.6 with improving JIT support, Webpack as the default JavaScript handler and increasing adoption of Kubernetes.

Railsconf 2018 – Pittsburgh

Tuesday 17 April. Snow. DHH poking fun at Twitter and raising alarms about Facebook. Nick Quaranto with a GraphQL intro: best for new APIs as a mobile backend. Sean Griffin trying to encourage Rails contributions by labeling it a legacy app. Fastly presenting their not yet released alternative to docker-compose for developers. Olivier Lacan talking about the life and imminent death of CodeSchool.com. Taylor Jones with an introductory overview of Webpacker. Akira Matsuda teasing with his unfinished performance hack gems. Mark Imbriaco with a stellar career from AOL to Decisiv, 37signals, Heroku, Living Social (with Chad Fowler), GitHub, Digital Ocean and Pivotal.

Wednesday. Eileen Uchitelle keynote on upcoming Rails 6 features for scalability: baked in parallel tests (minitest) and polished multi-database support. Initially skeptical but ultimately inspired by her appeal for more companies to upstream their work. Justin Searles and Ted Kaufman talking about growing their agency. Chris Hoffman reviewing Optoro’s experiences adopting services: start with new business services, not an extraction, do something large enough to be noticed but as simple as possible, establish infrastructure standards and have developers support their services. Exhibition hall with booths by BTCOTC, Procore, GitHub, Heroku, Engine Yard, Cloud 66, Shopify, Scribd and LendingHome amongst others. After lunch James Adam recounting his struggle to popularize Rails engines and the forces shaping the framework’s evolution. Leanardo Targon of Plataformatic with an introduction to Warden. Admin frameworks BOF discussing modular monoliths, TrailBlazer and CBRA. Lightening talks including Clearwater and jsonapi-suite

Thursday. Snow again and chill winds. Sarah Mei filling in a keynote for Bari Williams: application development is interior decorating, not architecture. Sam Phippen with another well presented RSpec talk with the latest fixes to support system tests. Graham Conzett reminding how much can still be done with UJS alone. After lunch Ariel Caplan introduction to Swagger (OpenAPI) and (unmaintained?) apivore, Michael Crismali giving a quick review of JavaScript strategies, followed by Ross Kaffenberger giving actionable advice on dealing with Webpack. Finally Aaron Patterson proposing to upstream easier performance tuning into Rails.

Attendance looked up (2,000+), and more diverse.  No more ‘Rails is dying’ and React/Elixir FOMO. Webpack/services/JSONAPI for sure, but not too much beyond that.  Standards of the technical talks were good, especially Akira and Eileen. I missed the talks by Vladimir Dementyev and Justin Weiss and I look forward to the inspiring videos of Ernie Miller and Nicolas Means.

Year 7 with Rails

In my seventh year with Rails I started allocating ’20% time’ to maintenance of Active Admin and related open source gems.  As the universe of web technologies continues to expand and fragment there has been increasing acknowledgement at GitHub and elsewhere of the stresses on volunteer contributors and the consequent rise in the number of projects falling into disrepair.  Active Admin at least now has an official 1.0 release and timely support for Rails 5.1.
On the plus side competition and the exodus from Rails has brought back innovation, most notably Rails 5.1’s integration of NPM, Yarn and Webpack.  Beyond Rails in the wider Ruby community an object-functional style of programming is gaining popularity, championed by dry-rb and embraced by Hanami and Trailblazer.
This year has been one of considerable progress (and hype) around containers and microservices.  Microservices are not without tradeoffs but Docker containers have proven themselves useful in both development/CI and production.
At my employer our codebase has reached 50kloc, now 60% componetized into gems, but a new joint venture has doubled our infrastructure and provided incentive to switch to Docker (and Elastic Beanstalk).  Containerizing legacy applications is not always trivial, however, as adopting a 12-factor approach means simplifying and standardizing sometimes disparate logging and configuration solutions, as well as changing to process supervision in a stripped down POSIX environment instead of a full blown Linux host.  Our monitoring stack now includes Pingdom, Airbrake, Loggly, PagerDuty, Skylight, (CloudWatch) and Librato.  Moving CI to Docker has been challenging, with initially only CodeShip providing a SaaS solution with parallel tests each with multiple sets of containers.
Looking forward Rubyconf last November continued to raise hopes that performance and concurrency will be improved… eventually.  Meanwhile there are numerous projects working on integration with compiled languages: helix with Rust, swig with C/C++, Loren Segal’s gorb with Go, and rubex.  Crystal has gained attention as a Ruby-ish experiment on LLVM with its own MVC frameworks.
On the front end React may now be a ‘safe’ choice for front end development but possibly disruptive innovation continues with VueJS, CycleJS and Elm.  The next twelve months will see either our further adoption of React on Rails or a shift to a different approach.

RailsConf 2017, Phoenix, AZ

Tuesday. Day 1. Keynote by DHH on belief systems. Fascinating talk by Lance Ivy on JSON Web Tokens, Justin Weiss on sessions, Dave Tapley with an entertaining exploration of VueJS, ActionCable and image processing. Eileen Uchitelle with a much anticitpated presentation on adding a significant feature (SystemTestCases) to Rails. Alex Kitchens with a great primer on using Git to explore the history of the Rails codebase. Finally Sam Phippen, now with Digital Ocean, in much better health than last year, giving an upbeat tour of fixing some RSpec issues.

Wednesday. Day 2. Justin Searles keynote with a tongue-in-cheek programmer personality test inspired by Myers Biggs. Back to back presentations on Elm, Phoenix, React and Helix highlighting various Rails related technologies. Nate Berkopec with clear and practical guidance on configuring app servers on Heroku or elsewhere. Evening lightening talks, most notably Isaac Sloan building a Crystal Kemal blog in five minutes.

Thursday. Three talks on distributed teams, including Maria Gutierrez, Glenn Vanderburg, formerly of Living Social, and David Copeland of Stich Fix. Simon Enskilden on the decision at Shopify to embrace flash sales and scale from MySQL sharding to multi-datacenter ‘pods’. Tony Drake pitching his active_reporting gem, then Nate Berkopec and Eilieen Uchitelle again with Rafael Franca and Richard Schneeman on a performance panel before the final keynote from Aaron Patterson with his traditional trolling of DHH and, eventually, h2o with Rack 3.0.

Active Admin 1.0

Note: This post is by Varyonic, not the ActiveAdmin organization.

So after nearly seven years Active Admin 1.0 is out. It has been a long and sometimes uncertain journey of which I have witnessed only part. The original author has moved on, subsequent maintainers have burned out, changed jobs, started families… The bug list remains longer than we would like, the features list remains longer than we can handle, but Active Admin has been in production use for years at companies, NGOs and agencies, and there is commitment to keeping the project alive through quiet pragmatism rather than grand plans.

Not all of us have the time, money, or even need for the next shiny thing, and even if Active Admin sometimes cuts across ‘the Rails Way’ it can be a significantly productive tool. I encourage you to give it a try, to upgrade if you are already using it, to give us feedback if you find issues. General help is available on StackOverflow (tag #activeadmin); search the GitHub issues, both open and closed (~5,000 in total), before submitting anything new. If you are using Active Admin regularly consider looking through the code, issues and the commit log, maybe you will be inspired to contribute, even if just documentation or translations. If you are working for an agency with multiple customers you may be able to provide valuable insight and encourage adoption.

So thank you to all 500+ contributors so far and especially Timo for the past couple of years, here’s to the next 1M downloads.

Posts navigation

1 2 3
Scroll to top