Git Product home page Git Product logo

Comments (2)

jayeb avatar jayeb commented on September 26, 2024

Hi @KillerCodeMonkey,

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.

KillerCodeMonkey avatar KillerCodeMonkey commented on September 26, 2024

from imgix-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.