Reputation: 5647
I would like to show a spinning 'loading' image while 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?
Upvotes: 1
Views: 93
Reputation: 16355
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
Upvotes: 3