
Building a Rails Engine #8 — Real-time Progress with ActionCable & Stimulus
Real-time Progress with ActionCable & Stimulus How to push live progress updates from a background import job to the browser using a Broadcaster service, an ActionCable channel, and a Stimulus controller -- so users never stare at a dead spinner again. Context This is part 8 of the series where we build DataPorter , a mountable Rails engine for data import workflows. In part 7, we built the Orchestrator -- the class that coordinates the parse-then-import workflow in the background via ActiveJob. The problem The user clicks "Import". The job goes into the queue. And the page sits there. No progress indicator. No feedback. No way to know if the import is 10% done, 90% done, or failed entirely. The only option is to refresh and check the status column. For a 50,000-row CSV that takes two minutes, that is a terrible experience. Before: click "Import" → spinner → ??? → refresh → refresh → done (maybe) After: click "Import" → live progress bar 0%...50%...100% → auto-reload with results Rails
Continue reading on Dev.to Webdev
Opens in a new tab


