Skip to content
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

Merged
merged 2 commits into from
Dec 11, 2013
Merged

Fix relative URLs in bower components #49

merged 2 commits into from
Dec 11, 2013

Conversation

jimpo
Copy link
Contributor

@jimpo jimpo commented Dec 11, 2013

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 an asset_path call. This way all CSS files in bower components will work in both development and production.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 857a345 on jimpo:master into 520884a on 42dev:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling e5c4943 on jimpo:master into 520884a on 42dev:master.

@SergeyKishenin
Copy link
Collaborator

Thanks for the request. This will affect *.css files that are already installed, right? What about the newly installed assets? rake bower:resolve should be run every time anybody add a new package? Maybe it would be better to make it "just work"?

@jimpo
Copy link
Contributor Author

jimpo commented Dec 11, 2013

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 resolve_asset_paths method in the install and update tasks.

SergeyKishenin added a commit that referenced this pull request Dec 11, 2013
Fix relative URLs in bower components
@SergeyKishenin SergeyKishenin merged commit 42fa6cf into rharriso:master Dec 11, 2013
@SergeyKishenin
Copy link
Collaborator

Agree, merged!

@rharriso
Copy link
Owner

Thanks for the new feature.

Could you add an explanation to the README?

@jimpo
Copy link
Contributor Author

jimpo commented Dec 11, 2013

#51

@SergeyKishenin
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants