2

I would like to create one web service in Ruby (Rails 3 application), which will

  1. accept an Excel file having data for users and user profiles (about 30 columns),
  2. migrate the data to Database and
  3. generate a match report (another Excel) and send that back to user.

The Import Excel files columns are like Email,First Name, Last Name, Country, City, Tags (comma separated values)

The Match Excel file will be having columns like Email_excel, Email_db, match(true/false), First Name_Excel, First Name_db, match(true/false)...

Or is there any other way to deal with this scenario.

Update 1: I am using spreadsheet 0.6.5.9 to perform all the above mentioned operations and everything is working fine in web interface through file upload (paperclip). But how can I make this feature available as web service.

Any help, link or suggestions is appreciated. Thanks.

asitmoharna
  • 1,484
  • 11
  • 15

1 Answers1

1

This is a good start on how to do what you want. Once you read the spreadhseet in and then parse it you would cycle through and post the data to your DB. This may also help.

Community
  • 1
  • 1
ScottJShea
  • 7,041
  • 11
  • 44
  • 67
  • Thanks for your response. I am using spreadsheet 0.6.5.9 to parse the Excel file and its working fine for me. I am able to import data from Excel as well as generating the match report. But, my problem is to make my feature available as Webservice. How can I write a web service that can accept an Excel file and return an Excel file. – asitmoharna Feb 23 '12 at 05:07
  • 1
    Check out this for uploading: http://guides.rubyonrails.org/form_helpers.html#uploading-files and this for sending excel: http://stackoverflow.com/questions/3962896/difficulty-with-send-data-in-ruby-on-rails-in-conjunction-with-spreadsheet-plug – ScottJShea Feb 23 '12 at 05:13