Comments (3)
So I wanted to use multiple sources and be able to specify each one from the helper. We have some assets in s3 and some in our repo.
Long story short, the multiple hosts are for sharding. imgix-rails doesn't have any hand in it, it comes from the underlying imgix gem. PR is here: https://github.com/imgix/imgix-rb/pull/3/files and there are some docs in the imgix-rb repo about the motivation behind sharding.
from imgix-rails.
I'm confused too.
How to use it?
Rails.application.configure do
config.imgix = {
sources: {
"assets_foobarbaz.imgix.net" => "foobarbaz",
"assets_nil.imgix.net" => nil, # Will generate unsigned URLs
},
default_source: "default_source.imgix.net"
}
end
include Imgix::Rails::UrlHelper
puts ix_image_url('/users/1/avatar.png', { w: 400, h: 300 })
# => https://assets_nil.imgix.net/users/1/avatar.png?w=400&h=300
I expet to use below but it's not work T.T
puts ix_image_url('foobarbaz', '/users/1/avatar.png', { w: 400, h: 300 })
# I expect
# => https://assets_foobarbaz.imgix.net/users/1/avatar.png?w=400&h=300
# It shows an error
# => Unknown source 'foobarbaz'
Can someone help me?
from imgix-rails.
Closing as this issue is quite old. If anyone still has questions about multi-source support, please feel free to comment here or open a new issue altogether.
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
- max_width not working HOT 4
- Support Multiple Sources HOT 4
- data-srcset instead of srcset HOT 5
- Switching between dev (local filesystem) and production (aws s3) HOT 2
- 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.