How to implement a progress bar in Ruby?

2019-07-13 17:11发布

We want to implement a progress bar for file uploading in one of our Ruby application. This needs to show the exact percentage of the upload. However, despite our best efforts we could not find a way to implement a progress bar that exactly replicate the file upload process.

Can you please help us with this?

2条回答
做自己的国王
2楼-- · 2019-07-13 17:37

If your are using Apache and Passenger, you can use the Apache progress bar module.

Screencast: http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html

Apache Module and installation instructions: http://drogomir.com/blog/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache

查看更多
Viruses.
3楼-- · 2019-07-13 17:44

I have used mongrel_upload_progress in the past, but I found that it was quite a complex and delicate solution to the problem. I'd definitly recommend looking towards using passenger thru apache for your production environment, though.

查看更多
登录 后发表回答