tsechingho/chosen-rails

Unable to load chosen-sprite.png

Fredar opened this issue ยท 7 comments

Seems like last update has broken the chosen-sprite.png in production.

I can see in the last commit that the image-url was changed to url
b9ea71b#diff-be0b0e9aa033e51570b0a1a8886aef4aL4

Yet in other files it remained the same
https://github.com/tsechingho/chosen-rails/blob/master/vendor/assets/stylesheets/chosen.scss#L6

Not sure if thats the reason though.

Came across this comment which explains the issue
https://stackoverflow.com/questions/9304607/sass-rails-helpers-image-url-asset-url-are-not-working-in-rails-3-2-1#comment22212758_11819234

Indeed with 1.8.2 it tries to call the file without the fingerprint.

Also confirmed in dev that restoring image-url brings back the fingerprint.

Appears #98 was meant to resolve this, but using 1.8.3 in production causes the same error as above in this thread.

Perhaps https://github.com/tsechingho/chosen-rails/blob/master/vendor/assets/stylesheets/chosen-base.scss#L3 should be updated to use image-url sass function as well as the changes introduced in #98?

I was able to resolve my issue in production, still using version 1.8.3, by defining the variables before importing the chosen CSS.

Example:

// app/assets/stylesheets/application.scss
$chosen-sprite: image-url('chosen-sprite.png');
$chosen-sprite-retina: image-url('chosen-sprite@2x.png');

@import "chosen";

I will fix this recently.

Any chance of getting this resolved? I have both a Rails 4.2 project and a Rails 5.2 project where this is an issue. @macfanatic's fix works great afor both, but it would be great got get this fixed in the main release. Thanks!

It seems like https://github.com/tsechingho/chosen-rails/pull/101/files might resolve this.

donv commented

(Ignore my previous comment. I had an override in a local file)

I think this issue can be closed as fixed.