-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix relative URLs in bower components #49
Conversation
Thanks for the request. This will affect *.css files that are already installed, right? What about the newly installed assets? |
Since bower components will work in development regardless, it only has to be run before precompilation. That is why I added the prerequisite tasks to assets:precompile. However, it wouldn't hurt to just run the |
Fix relative URLs in bower components
Agree, merged! |
Thanks for the new feature. Could you add an explanation to the README? |
e5c4943 forces to have Bower installed on a remote server. Is it a good idea? Sometimes it can be excess for someone. Maybe should we provide an option to choose how to deal with assets? |
There are many bower components with CSS files that have relative image URLs in them. For example, Bootstrap 2, jQuery UI, and JCrop all do this. This is fine in development, but when the assets are compiled with
rake assets:precompile
, the links to these images break. This is why Rails has special helpers for asset links.I have created a
bower:resolve
task to replace all relative paths to anasset_path
call. This way all CSS files in bower components will work in both development and production.