dimanche 1 mars 2015

Why does Rails not serve up images with the word "background" in their name?

This is not working in my development environment.


I browsed around Google and SO for related posts, and tried everything mentioned here: Rails 4 image-path, image-url and asset-url no longer work in SCSS files


I've tried putting my image in the stylesheets directory, putting it in the images directrory, trying to access it with asset-url, image-url, url, from assets/images/my-image.jpg, images/my-image.jpg, my-image.jpg, assets/my-image.jpg, none of these work. I've checked development.rb in the config/environments and i'm not configured to serve_static_assets, although I'm precompiling some glyphcons in assets.rb and appending some text to that to precompile font files in application.rb, but I don't see how that would keep my images from being sent up by the server.


I checked that my stylesheets were getting sent by restyling some of my page, and they are getting served, so it is an issue of the images not being sent. I have been clearing the cache between test runs, as well, and have been receiving logs in the console that my desired image is searched for but then not found.


Any ideas as to what might be causing this? I'm running Rails 4.2.0 with ruby 2.1.5.


More Details: I discovered that this issue had something to do with the fact that my image contained the word 'bockground' in the image name. If somebody can answer the question of, "is it really the image name, as it seems, since changing the name of the image worked? Or is it deeper than that?" That would be great, but if not, Rails is huge, so could somebody give me a starting point in Rails for investigating the code to find out exactly what logic filters out images that either start with or contain the word 'background'?


I thought maybe Sprockets would be the place for this, but I'm not sure Sprockets actually sends the Assets, it just compiles them, and I'm not sure if it does anything with images or if it just handles compiling Sass and JavaScript and stuff... The Readme wasn't that specific about the role of Sprockets, if I was reading things correctly and fully.


Aucun commentaire:

Enregistrer un commentaire