Ask A Question

Notifications

You’re not receiving notifications from this thread.

Render before action completes

Peter vande Put asked in Rails

Controller action is taking a couple of seconds (complex calculations in dashboard) and i want to display a spinner on the html.erb file while waiting so basically start the rendering before the action completes. How can I do this?

Reply

Julian Rubisch put together a gem that makes this easy: https://github.com/julianrubisch/futurism

Reply

Let me know if I can help!

Reply

Julian looks nice one question I wanna show a spinner while building my variables which are about 20 which are rendered as graphs

How should I use your gem for this

Reply

Futurism relies on CableReady which will just swap out any placeholders once the contents are ready. It expects them to be wrapped in partials though

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 73,723+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.