I have a "Rule list" on "localhost:3000/rules" and its JSON render on "localhost:3000/rules.json"
I want to creat the action "Publish" to upload this json to my FTP but I don't find the solution to make this with Net:FTP.
Here's my code : rules_controller.rb
def publish
require 'net/ftp'
ftp = Net::FTP.new('xxxxxx', 'xxxxxxxx', 'xxxxxxx')
ftp.chdir('www/lol')
ftp.putbinaryfile('rules.json')
ftp.close
end
Thanks in advance