drogus / bulk_api

MIT License
149 stars 7 forks source link

Todos.store.commitRecords() -> PUT "/api/bulk" -> Psych::SyntaxError (couldn't parse YAML...) #14

Open drnic opened 13 years ago

drnic commented 13 years ago

In the todos app, I've added Todos.store.commitRecords(); to "Mark All as Done" toggle but the PUT request is failing with a YAML?! error:

  allAreDone: function(key, value) {
    if (value !== undefined) {
      this.setEach('isDone', value);
      Todos.store.commitRecords();
      return value;
    } else {
      return this.get('length') && this.everyProperty('isDone', true);
    }
  }.property('@each.isDone')

On the Rails server log:


Started PUT "/api/bulk" for 127.0.0.1 at 2011-06-10 18:24:47 -0700
Error occurred while parsing request parameters.
Contents:

Psych::SyntaxError (couldn't parse YAML at line 1 column 40):

Rendered /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_trace.erb (60.5ms)
Rendered /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms)
Rendered /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (132.6ms)
aflatter commented 13 years ago

This should be related to the ruby/rails/psych/syck drama. Your app works fine for me with ruby 1.9.2 and rails 3.0.7 as your Gemfile suggests.

EDIT: I was wrong about the rails version I'm using ;)

drnic commented 13 years ago

So for ruby 1.9.2p180 + rails 3.0.7 it works fine for you? Pooey. :)

drogus commented 13 years ago

@drnic can you paste JSON that is sent to the rails app?