swapImage {src: 'image2.jpg'} problem in Rails 3.1

Hi Chad:

Thanks for this. I’ve implemented this change and it nicely gets around the issue of nesting double and single quotes to provide the JQuery swapImage function the src: argument it needs.

In development, everything now works as desired. The rollovers work great with no broken images. (Actually, they worked before, as long as I stuck /assets/ in front of the image names.)

Unfortunately, though, when I deploy this code to production, the rollover still doesn’t work. I get no apparent rollover response at all. Also, the single quote still appears escaped when I view source.

You can view this online at staging.genlighten.com/login. (Ignore the other current problem on that page with the broken CSS around the search form; that’s a question for Kyle Fielder, I’m guessing.) The “Sign In” button is the one with the swapImage rollover code. That button should display a somewhat darker button image in the hover state, but doesn’t.

I’m wondering now if perhaps I’m not loading my javascript/jquery assets correctly using the asset pipeline.

But when I check https://staging.genlighten.com/assets/application.js, I see the swapImage code appearing just fine.

I’m using EngineYard to host my site, so it’s also possible that something in their configuration doesn’t reflect my having upgraded to Rails 3.1, but that seems less likely than that the problem is something simple I’ve overlooked.

Any suggestions for next steps would be appreciated…

Thanks!

Dean Richardson
Genlighten.com