Scriptaculous Effects Tutorial for Begineers!!!!

Thanks once again for inspiration to Brian Eng of Softies on Rails, here's my latest tutorial. Brian mentioned how easy it would be to add script.aculo.us effects to my little delicious app. And he was totally correct. What are script.aculo.us effects, you ask? Go check out this page.

Click on each of the little demo boxes and watch the magic. Now say, "Holy crap! That's cool!" Then come back and I'll tell you how to add any of that to your Ruby on Rails app.Here we go. script.aculo.us depends on the prototype javascript library which comes with the latest version of Rails. So, we just need to get script.aculo.us into our app.

First download and unzip the latest script.aculo.us code. Open the src folder and grab the files which do not exist in your rails app's public/javascripts directory. Copy these files over to this directory. Add this line between the 'head' tags in your layout.rhtml file:

Now you have the power of script.aculo.us in your rails app! NOTE: I just saw on the script.aculo.us home page that it is supposed to be bundled with RoR. I didn't notice in my directory, but this step may not be necessary for you.

Remember in my last tutorial when I added in the spinner effect, I used the :loading and :completed callbacks? Like this:

Read the complete tutorial Here

No comments: