bootstrap-colorpicker-rails icon indicating copy to clipboard operation
bootstrap-colorpicker-rails copied to clipboard

Change the path of assets

Open jastkand opened this issue 11 years ago • 7 comments

While migrating to Rails 4 I had an issue when the application couldn't find css and javascript files. Changing the path of assets fixed the problem.

I've tested fixed version of the gem on Rails 3.2.13 and it still works fine.

jastkand avatar Jul 07 '13 18:07 jastkand

@jastkand you forgot to change the .css extension to .css.scss

acaron avatar Jul 04 '14 15:07 acaron

Yes, this would be greatly appreciated as we are also using this gem with Rails 4.

Thanks !

bourgeois avatar Jul 04 '14 15:07 bourgeois

@alessani I made a pull request #14 working with rails 4. The other pull request ( #11 ) was not working.

acaron avatar Jul 04 '14 16:07 acaron

@acaron What do you mean by not working? Adding .scss extension is not necessary as sprockets can handle asset-url helpers in .css files.

jastkand avatar Jul 04 '14 16:07 jastkand

@jastkand see the document here: http://guides.rubyonrails.org/asset_pipeline.html "When using the asset pipeline, paths to assets must be re-written and sass-rails provides -url and -path helpers (hyphenated in Sass, underscored in Ruby)[...]"

and the answer here: http://stackoverflow.com/questions/15257555/how-to-reference-images-in-css-within-rails-4 "asset-data-url works for me after I changed my .css file to .css.scss file in a Rails 4 app"

Since it is sass-rails that provides helpers, it must be a .scss file. It was not working for me with a css file, it was interpreted as pure css. Hope this help!

acaron avatar Jul 04 '14 17:07 acaron

Well, I see. It might be worked for me as I always were including .css files in .scss ones. @acaron's pull-request (#11) is much cleaner and is better to be merged. I fixed my version though.

P.S. Sorry I didn't noticed that everything is already merged and fixed :smile:

jastkand avatar Jul 04 '14 17:07 jastkand

@jastkand ah! of course it was working then :smile: now the gem is up to date and we are all happy!

acaron avatar Jul 04 '14 17:07 acaron