stevo / colorbox-rails

Make links open in lightbox a breeze
MIT License
77 stars 58 forks source link

Images not loading - rails 3.1.3, colorbox-rails 0.0.8 #4

Closed klump closed 12 years ago

klump commented 12 years ago

hi there,

i installed colorbox-rails via 'gem install colorbox-rails' and added the lines to the application.js and application.css. The colorbox window works, but there are no pictures. The colorbox is just a ugly white spot. Rails gives me a 404 error for the images. What am i doing wrong?

Thanks

eostrom commented 12 years ago

I have the same problem in Rails 3.2.rc2. The recent change to use relative URLs (or, different relative URLs) makes Firefox request, e.g., /assets/colorbox-rails/colorbox-rails/overlay.png. The image isn't there, but it can be found in /assets/colorbox-rails/overlay.png.

I suspect what's going on is that @klump and I are testing in development mode. The CSS file is loaded separately (from /assets/colorbox-rails/colorbox-rails.css), and the image URLs are relative to that, so we get an extra colorbox-rails/ in the path. And @rboyd, I bet, fixed things for production mode, where the CSS is compiled into one big /assets/application-*.css, and the relative image URLs are right in /assets/colorbox-rails/, as they should be.

Not sure what the best asset-pipeline-friendly fix is.

eostrom commented 12 years ago

... The asset-pipeline-friendly fix is asset_path - see my pull request.

klump commented 12 years ago

i just updated to rails 3.2 and now it is magical working :P thanks