I have to create a new project in rails which has a long running task,
so i need a way to indicate percentage of task completed.
updates like:
0% Task started
25% task completed
50% task completed
75% task completed
100% complete.
How can i send these task updates from controller action to view in
rails.
You can’t follow that approach directly as you can’t send back the
response bit by bit with rails (and it’s a bad idea to have such long
running actions because they will stop the mongrel accepting
connections). The usual approach is to offload the processing task to
something like backgroundrb.
can i use AJAX updating multiple times within the same controller
action?
which method should i use. for getting long running process with last
around 30 seconds.