Stylesheet assets with period in the name cannot be loaded when config.assets.compile = true #3398

Closed
sgulics opened this Issue Oct 21, 2011 · 5 comments

2 participants

@sgulics

I am seeing this issue in Rails 3.1.1. The file with period is not part of the precompile process.

To reproduce:

  1. Add a file called ui.jqgrid.css to app/assets/stylesheets

  2. Add the following to your view
    ```<%=stylesheet_link_tag 'ui.jqgrid.css' %>

3. In production.rb set config.assets.compile = true

4.  rails s -e production

5. The request to http://localhost:3000/assets/ui.jqgrid-8f27f84a702932cb91b30d27d58ebef1.css returns a 404

Javascript assets are fine if they are in app/assets/javascripts, but I did notice that you will get a 404 if you try to load a js file with a period in the name, for example  "jquery.validate.min.js",  that is located in the vendor/assets/javascripts directory

The stylesheet will be found if you set config.assets.digest = false

@kennyj

I reproduced this issue.

I think that this problem is sprockets's problem.
I think that Sprockets::AssetAttributes#path_fingerprint method return invalid result in this case.

In my hand this problem has been fixed. I'll try a little test.

@kennyj

I opened pull request to sprockets.
please see sstephenson/sprockets#230

@sgulics

kennyj, thank you for looking into this

@kennyj

sgulics
cc @spastorino @guilleiguaran

@josh commited sstephenson/sprockets@4ba5b32
Maybe it will be fixed when next sprockets is released.

@sgulics

I just verified the fix and it looks like it is working properly. thanks again

@sgulics sgulics closed this Oct 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment