Programmatically ftp from rails app

I would like to create the functionality to ftp a file from my rails
CMS system, does anyone have some insight on FTP functionality/code?

Here we go:

require 'net/ftp'

ftp ='')
ftp.login(user = "****", passwd = "****")
ftp.putbinaryfile("/data/images/myimage.jpg", File.basename( "/data/
images/myimage.jpg" ))

Also you would obviously want to through a rescue in there for ftp

thank you bud