Skip to content

Instantly share code, notes, and snippets.

@hazmatzo
Created June 26, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hazmatzo/267ee4ff32f33243530582689708dee4 to your computer and use it in GitHub Desktop.
Save hazmatzo/267ee4ff32f33243530582689708dee4 to your computer and use it in GitHub Desktop.
This is how to attach a file from a URL in Active Storage.
filename = "resume.pdf"
uri = URI.parse(“https://someresume.com/resume.pdf”)
candidate.resume.attach(io: uri.open, filename: filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment