Skip to content

Instantly share code, notes, and snippets.

@bholzer
Created March 29, 2014 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bholzer/9864704 to your computer and use it in GitHub Desktop.
Save bholzer/9864704 to your computer and use it in GitHub Desktop.
def import_contacts(file)
contact_file = Tempfile.new(['contact','.xlsx'], :encoding => 'ASCII-8BIT')
contact_file.write(file.tempfile.read)
contacts = CSV.parse(Roo::Excelx.new(contact_file.path).to_csv)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment