drogus / bulk_api

MIT License
150 stars 7 forks source link

Followed readme but didn't get JSON data from /api/bulk #6

Closed drnic closed 13 years ago

drnic commented 13 years ago

Hey, thanks for making this gem and the great write up of the README.

I created a simple one model app [Todo (title, is_done) model] and added two records and called curl http://localhost:3000/api/bulk but am getting {} returned.

I've pushed up my code to https://github.com/drnic/todos-bulk-api-demo - can you spot what I've done wrong? Sorry that I failed at reading the readme correctly :)

I've tested this against latest gem + latest HEAD of master.

aflatter commented 13 years ago

Hey,

Try curl http://localhost:3000/api/bulk?todos=all. Your application works fine for me. Creating a todo did not work because you have to tell sproutcore to commit it:

createTodo: function(title) {

You could also use Todos.store.commitRecordsAutomatically = YES.

I had to git clone http://github.com/drogus/bulk_data_source.git app/sproutcore/frameworks/bulk_data_source.

drnic commented 13 years ago

Ahhh, I did not know I needed to pass any parameters into the curl request.

Thanks also for preempting issues I was about to have with creating records :)

Nic

Dr Nic Williams Engine Yard, VP Technology Silicon Valley Ruby Club, President http://engineyard.com http://drnicwilliams.com cell +1 (415) 860-2185

On Tuesday, June 7, 2011 at 9:26 AM, aflatter wrote:

Hey,

Try curl http://localhost:3000/api/bulk?todos=all. Your application works fine for me. Creating a todo did not work because you have to tell sproutcore to commit it:

createTodo: function(title) {

  • Todos.store.createRecord(Todos.Todo, { title: title });
  • var record = Todos.store.createRecord(Todos.Todo, { title: title });
  • record.commitRecord(); },

You could also use Todos.store.commitRecordsAutomatically = YES.

I had to git clone http://github.com/drogus/bulk_data_source.git app/sproutcore/frameworks/bulk_data_source.

Reply to this email directly or view it on GitHub: https://github.com/drogus/bulk_api/issues/6#comment_1317623

aflatter commented 13 years ago

btw, http://www.engineyard.com/ is down. ;)

drnic commented 13 years ago

Oh awesome :)

Thanks for the bug report; we'll get back up into existence! :D

Nic

Dr Nic Williams Engine Yard, VP Technology Silicon Valley Ruby Club, President http://engineyard.com http://drnicwilliams.com cell +1 (415) 860-2185

On Tuesday, June 7, 2011 at 10:21 AM, aflatter wrote:

btw, http://www.engineyard.com/ is down. ;)

Reply to this email directly or view it on GitHub: https://github.com/drogus/bulk_api/issues/6#comment_1318604

drnic commented 13 years ago

Ok, fixed https://github.com/drnic/todos-bulk-api-demo

aflatter commented 13 years ago

Cool; Added it to README: https://github.com/drogus/bulk_api/pull/8