visual_effect bug fix in Rails 2.0

I noticed something interesting while enhancing Teascript today. I recently upgraded the app to Rails 2.0 which ended up breaking several of the Scriptaculous visual effects that I had been using to highlight certain parts of the page when things changed. This is how I had called visual_effect in the past:

page.visual_effect :highlight, "activities_list", :endcolor => "'#DDDDDD'"

Notice the extra set of single quotes inside the endcolor value. I had to add these single quotes due to a small bug in the Scriptaculous helper. Apparently, the helper didn’t automatically place single quotes around the endcolor value when emitting JS for the page. Well, the good news is that this has been fixed in Rails 2.0, so I was able to update my visual_effect calls to:

page.visual_effect :highlight, "activities_list", :endcolor => "#DDDDDD"

The bad news is that this change broke Teascript for several days since I initially didn’t notice what was going on. But all is well now, and I’m happy that I don’t have to add those useless single quotes any more.