jquery - how to send data from controller to a view in ruby -


I am working with Ruby and I need to constantly send status message status to the user, whereas for a long time The running work is being done in the controller

The method contains some rows on the database. The user wants to show a message like this:

The upload is in progress, the number of files has been exchanged.

Currently I have a LoadMask jQuery plugin but it only shows a simple message, and I do not know how to send the number of rows inserted with interrupting the process.

You should consider moving this long-running process into a background function, so that you can immediately Can respond to the user. After the background job is deposited on the basis of your background processing engine, you will be able to check the status of jobs. It is probably easy to keep track of the situation (depending on your work) either use your database (or create a separate table for it) or Redis. After the job has been deposited, you will have to return the job ID which you can use to vote for the update.

Create a new controller (or verb), which you can use to add jQuery + Ajax and Voting changes.

Late Job, Rescue, etc.

Please see: / P>

Oh, if you are just looking for a simple file upload progress indicator, see it

here you try streaming technology You can, here's a lot of information:

Comments