I've added a helper method to my Application controller:
def unzip (file, destination)
Zip::File.open(file) do |zip_file|
zip_file.each do |f|
f_path = File.join(destination, f.name)
FileUtils.mkdir_p(File.dirname(f_path))
f.extract(f_path)
end
end
end
and I get the error:
private method `open' called for Zip::File:Class
When I run this in the Interactive Ruby shell, it works fine. How do I implement this on Rails 4?