Making the assumption that you are trying to build a view of the contents of the zipfile similar to Githubs representation, after uploading said zipfile to your server, the easiest way would be to:
- Use RubyZip Zip::ZipFile to access the uploaded Zipfile (how to store it as file db depends on your needs).
- Store the contents in a nested hash and display said hash in a view. The hash can then include drill down links to the extracted files.
To give you a simple example stub how to parse the file (e.g. named test.zip)
Zip::ZipFile.open("test.zip") do |zipfile|
zipfile.each do |entry|
# Do something with the enty / create your hash like you need it
end
end
You can find more details in the documentation.
HTH