Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Showing status of current requ...

Replytotopic

Showing status of current request by AJAX

Posted in Forums : Ask a Rails expert

 
Profile

Authority 0
Posting Rating 0
Sign in to rate this post

Hi everyone,
I’m trying to develop an application which modifies a couple of tasks of the famous Online-TODO List RememberTheMilk (rememberthemilk.com) using the REST API.

Unfortunately the modifying takes a lot of time, so I want to give a feedback to the users.
My idea was just to display a couple of text lines (e.g. modifying task 1 of n…).

Therefore I used the periodically_call_remote on my page and called a which reads a Singleton.
In the request I store the text that should be displayed in the same singleton. But I found out, that once I set up a request, the periodically_call_remote does not update the specified div.

My question to this:
1. is this a good way to implement this behaviour?
2. if it is, how do get the periodically_call_remote to work during a submit?

regards
leifg

 
436907d871deeaa04aa3f0cb4548587e

Authority 50
Posting Rating 55
Sign in to rate this post

You may want to consider processing the task asynchronously, if you aren’t doing this already. DelayedJob is an excellent way to do this: http://tobi.github.com/delayed_job/

As for reporting on status, you could do this by polling asynchronously. Make sure that the entire page loads each time the user navigates before starting the polling task. Alternatively, you could try these alternatives:
  • Send email when the task is done.
  • Check the status of the request on each page render, and report the status in a flash message.
  • Display an alert message in the browser when the task is done instead of updating the page directly.
 
Www

Authority 87
Posting Rating 2
Sign in to rate this post

What is ruby, and ruby on rails, and why should I care?
I have seen a lot of stuff about the programming language ruby around lately. I have looked for information on it, and it is at least 10 years old. Why am I only hearing about it now? And what is “ruby on rails”?

Replytotopic

Other Recent Topics

Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController

Ask a Rails expert : Best way to structure a database for a large/static dataset

Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)

Ask a Rails expert : Above Ground Pool Supplies

Ask a Rails expert : How to get url params in observer or model in Rails 3.1

Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?

Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?

Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )

Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob

Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel