0

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?

4

1 回答 1

1

我认为您使用的 gem 仅用于在控制台中显示进度条。(如果您要制作任何系统工具或任何非基于 Web 的类似工具)

我相信你想要某种 ajax 功能。为此,您需要学习 javascript,我建议您从 Mozilla https://developer.mozilla.org/en-US/docs/JavaScript获得文档

然后看看jquery http://jquery.com/和jquery-ui,尤其是进度条小部件 http://api.jqueryui.com/progressbar/?rdfrom=http%3A%2F%2Fdocs.jquery.com% 2Fmw%2Findex.php%3Ftitle%3DUI%2FProgressbar%26redirect%3Dno

还看看 ajax 在 Rails 中是如何完成的http://blog.madebydna.com/all/code/2011/12/05/ajax-in-rails-3.html

于 2013-05-23T10:56:55.130 回答