Comments (2)
We decided to remove the hostnames_to_replace
functionality as part of an ongoing effort to hone and focus the functionality of our client libraries to unify them and focus on the most important features. We determined that this kind of hostname replacement was a rare enough use case and was relatively trivial for an end-developer to implement directly that it should not be supported as a first-class feature of this library.
You should be able to replicate the old hostnames_to_replace
functionality without too much fuss by doing some string manipulation on your URLs before you pass them into any imgix helper functions. Here's how we were doing this previously:
def replace_hostname(source)
new_source = source.dup
# Replace any hostnames configured to trim things down just to their paths.
# We use split to remove the protocol in the process.
hostnames_to_remove.each do |hostname|
splits = source.split(hostname)
new_source = splits.last if splits.size > 1
end
new_source
end
Hope this helps. I'm gonna close this ticket, but please re-open if you have any issues or further questions.
from imgix-rails.
from imgix-rails.
Related Issues (20)
- Updating imgix-rb dependency to v4? HOT 2
- ssrf external service interaction to malicious external source - security issue HOT 8
- `ix_image_url` doesn't work with fingerprinted assets anymore HOT 3
- Usage with multiple sources? HOT 1
- Multiple secure_url_tokens when using multiple sources HOT 3
- max_width not working HOT 4
- Support Multiple Sources HOT 4
- data-srcset instead of srcset HOT 5
- SemVer? Changelog? HOT 4
- ix_picture_tag provides wrong ouput of v3 HOT 1
- extra srcset link generated causes issue on non-retina displays HOT 1
- bundler restricted to version <2.0
- ActiveStorage support HOT 5
- Support latest version of imgix-rb HOT 1
- How to use inside a model? HOT 9
- `min_width` and `max_width` are rendered to HTML tag HOT 1
- Digest hash HOT 3
- Getting static image instead of GIF HOT 4
- data attributes instead of plain srcset, src, sizes attribute HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgix-rails.