开发者

rails running methods after view is loaded

I would like to show a spinning 'loading' image whil开发者_StackOverflow社区e my method computes some things and returns the results to the view.

Currently, it just looks as though the page isn't loading at all and then does (it's performing the method).

Any ideas?


One approach would be for the page you're loading to simply be the loading indicator, and have it do an AJAX request to retrieve the rest of the results (you can use jQuery or something similar to issue the request and then insert the results into the document).

If you're feeling up to it, you could instead use the HTTP streaming support that's new in Rails 3.1.

http://railscasts.com/episodes/266-http-streaming

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜