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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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