简体   繁体   中英

Surveyor Gem checking results from completed surveys

I have got small problem. I have installed Surveyor gem. I've made a rails aplication on my computer, and when entering: http://localhost:3000/surveys I can answer on my surveys. Adding new surveys is not a problem, but i haven't got any idea how to get results from copleted surveys in string.

I understand that results are in 'db' folder developement.sqlite3. I know that each line is one record in database, and each element is one type of variable (int,string, date), but how to take it out from the database and then transform it into string? I haven't got idea how to search for the solution!

C:\Ruby192\projekt\sample\db>rails db
SQLite version 3.7.14.1 2012-10-04 19:37:12

Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT*FROM response_sets;
1||1|nJL41HC_GQ|2012-12-11 14:30:21.024080|2012-12-11 14:32:04.367168|2012-12-11
 14:30:21.055329|2012-12-11 14:32:04.460918|ba67a3c1-c784-4ac3-af6d-e79a62089f8d

    sqlite>

My software:

ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

Rails 3.2.9

sqlite3 (1.3.6 x86-mingw32, 1.3.5 x86-mingw32)

sqlite3-ruby (1.3.3)

surveyor (1.1.0)

The query you run seems to be the result of a joining table. Check again surveyor documentation in order to set the appropiate relations between models. 'belongs_to' 'has_many' ...

Also, take a look to the migrations that surveyor created in order to have an idea of how the tables are related.

This is my best guess b/c I didn't really understand what the problem is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM