Created
October 27, 2009 08:29
-
-
Save asanghi/219415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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