On 12 May 2011, at 13:19, Sebastian wrote:
I have a button that links to a controller which is updating all my
entries in my db with new data, called from an external xml-based web
service. That can take several minutes, so I want to show the actual
progress in the view.
What is the best approach to do that? Java, AJAX...???
I found many 'upload progress bars', but I don't want to upload a
file.
I don't need a bar, it would be enough to show how many records are
left for updating, like this:
1/37
...
11/37
...
25/37
...
37/37 done!
Best way would be without refreshing the page!
You hand the task over to a background server, whichever flavor you
prefer (Nanite+Redis, Beanstalkd, …). This means you can keep on
serving other requests while the task is being done, as well as having
your user browse to another page (and when he requests the status
page, you just fetch the current progress).
There's several ways you can pass the progress to the view:
- Periodical polling through Ajax
- Some push server technology (there's a Railscast at http://railscasts.com
on this subject)
Best regards
Peter De Berdt
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.