Forum: Ruby on Rails How can I save a image with an image url in ruby?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bontina C. (Guest)
on 2007-01-30 15:21
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 topic is locked and can not be replied to.