I recently wasted over 2 hours because the lightbox script stopped working when I modified my views in Ruby on Rails.
The close and reload pictures weren't showing anymore, and this was not acceptable for publishing.
I worked over with a previous version of my code which did work, but no matter how many lines I copied from one place to another, my new code wouldn't work.
In the end, I checked the own lightbox.js content (I know little about javascript, so I didn't consider it an option until I was desperate). And the problem was there.
Lines 49 and 50 where:
fileLoadingImage: '../images/loading.gif',
fileBottomNavCloseImage: '../images/closelabel.gif',
This worked in my initial version because my view was http://localhost:3000/es/view_boat?model=First-53F5 so the ../images worked like charm.
But my new view was http://localhost:3000/es/barcos/1 So ../image failed. I first changed lines 49 and 50 of lightbox.js to ../../images/*.gif, but that was not optimal, so in the end I left them like this:
fileLoadingImage: '/images/loading.gif',
fileBottomNavCloseImage: '/images/closelabel.gif',
And that was it, here goes my first post!

No comments:
Post a Comment