Im using the Rails Roo Gem. I want to be able to get a .xls file from a https url. How can I do this.
I can easily switch to another gem such as Spreadsheet if necessary
Im using the Rails Roo Gem. I want to be able to get a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Retrieving a file is not the responsibility of your spreadsheet gem, but there are a number of ways to get things like that. The easiest is to use
open-uri, and the most robust is to use thecurbgem which is a wrapper around libcurl.Simple example:
The
curbgem has a pile of additional options that make this statement more tolerant of bad network connections and invalid SSL certificates, among other things. It can also be used to POST back a modified spreadsheet if that’s a requirement.