How can I save a image with an image url in ruby?

I would like to have a copy of an image file locally given an image url.
like this
def loadimage=(image_url)
…how to fetch image from an url…
File.open("#{RAILS_ROOT}/public/images/#{file.original_filename}",
“w+”) do |f|
f.write file.read
end
end

Anyone could refer any existing helper with the function I need?

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs