1

I'm trying to build a news article archival rails app.

The main goal is to allow all articles to be exported and download as a sqlite3 database file.

The purpose of that is so that the end user can use another app to view their articles offline.

I don't want to have to make an entire offline viewer if i can simply export data to the appropriate format.

tl:dr how to allow user to "download as sqlite3 database"?

Hayk Saakian
  • 2,036
  • 2
  • 18
  • 31

1 Answers1

0
  1. make the data as a CSV format file/object
  2. create a blank sqlite3 db file.
  3. import that CSV file/object into the SQLITE3 file
  4. write a streaming action into the controller to send user the CSV file. refer to : Ruby on Rails 3: Streaming data through Rails to client
Community
  • 1
  • 1
Siwei
  • 19,858
  • 7
  • 75
  • 95
  • >i have experience with 1 so that should be no problem >2 seems simple enough if i'm understanding you correctly (basically FIle.new with a .db extension) >3 is where you lost me, do you mean i should literally write csv data to that file? how do you do that? >i'll check 4 out now – Hayk Saakian Sep 02 '12 at 01:32
  • see here for importing CSV: http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles, also you need to google around. – Siwei Sep 02 '12 at 01:40
  • i'll look at that, but it doesn't seem like it's going to solve my problem – Hayk Saakian Sep 02 '12 at 01:50