P J S
P J S

Reputation: 172

How can I use ruby-progressbar in a Rails View?

I want to use progressbar in my view before the view finishes loading. So I installed ruby-progressbar and tried to follow the instructions in the documentation on this website. It works when I use it in my controller.

But I want to use it in my view before the data is loaded. How can I do this?

Upvotes: 0

Views: 503

Answers (1)

Simon Polak
Simon Polak

Reputation: 1989

I think the gem that you are using is only intented for showing the progress bar in console.(If you were to make any system tool or anything similar that is not web based)

I believe you want some kind of ajax functionality. For that you need to learn javascript, I would suggest documentation from Mozilla https://developer.mozilla.org/en-US/docs/JavaScript

Then take a look at jquery http://jquery.com/ and jquery-ui, especially the progressbar widget http://api.jqueryui.com/progressbar/?rdfrom=http%3A%2F%2Fdocs.jquery.com%2Fmw%2Findex.php%3Ftitle%3DUI%2FProgressbar%26redirect%3Dno

Also take a look how ajax is done in rails http://blog.madebydna.com/all/code/2011/12/05/ajax-in-rails-3.html

Upvotes: 1

Related Questions