Skip to content

Instantly share code, notes, and snippets.

@asanghi
Created October 27, 2009 08:29
Show Gist options
  • Save asanghi/219415 to your computer and use it in GitHub Desktop.
Save asanghi/219415 to your computer and use it in GitHub Desktop.
def import
file_param = params[:excel_file]
Spreadsheet.client_encoding = 'UTF-8'
begin
spreadsheet = Spreadsheet.open(file_param.local_path)
# do stuff with spreadsheet here using the spreadsheet api
rescue Exception => e
flash[:error] = "Error uploading Excel file : #{e.to_s}"
end
redirect_to root_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment