Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:01:50+00:00 2026-06-13T08:01:50+00:00

I have an action that takes a long time. I want to be able

  • 0

I have an action that takes a long time. I want to be able to provide updates during the process so the user is not confused as to whether he lost the connection or something. Can I do something like this:

class HeavyLiftingController < ApplicationController
  def data_mine
    render_update :js=>"alert('Just starting!')"
    # do some complicated find etc.
    render_update :js=>"alert('Found the records!')"
    # do some processing ...
    render_update :js=>"alert('Done processig')"
    # send @results to view
  end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:01:51+00:00Added an answer on June 13, 2026 at 8:01 am

    It is impossible to handle the request that way. For each request, you have just one answer.

    If your action takes a long time, then maybe it should be performed asynchronously. You could send user e-mails during the process to notify him of the progress.

    I suggest that you to take a look on DelayedJob gem:
    http://rubygems.org/gems/delayed_job

    It will handle most difficult parts of dealing with assync stuff for you (serializing / deserializing your objects, storage, so on…).

    Hope it helps you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that takes a long time to run and is intended
I have an action method that takes in two different objects. I am posting
I'd like to have an Index action for a Users controller that takes an
I have an action that relies on User.Identity.Name to get the username of the
Im not sure if I'm doing this right. I have an action that I
I have a complex action which can take a long time to run. If
I have written a framework that does calculations that take a long time to
I have a long running PHP script that i want to be executed in
i have an action that return a file content. i added: Response.AddHeader(Content-Disposition, attactment; filename:\
I have an Action that basically adds an item to a cart, the only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.