I’m very new in ruby on rails. I’m stuck with a problem. I want to make a file upload functionality through which I can upload any kind of file (text,image etc.). My controller
use "wb" instead of "wp". it works
File.open(path, "wb") { |f| f.write(upload['datafile'].read)}