Loading icon help

I want to create a loading icon in my Rails app when the page is taking a while.

Can somebody point me in the right direction of what I need to do?

I have basic knowledge of jQuery, and don’t know much about Ajax, and docs or tutorials or starting points will be very helpful.

Thanks

You might want to take a look at spin.js