bulk_api icon indicating copy to clipboard operation
bulk_api copied to clipboard

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

Open drnic opened this issue 13 years ago • 3 comments

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)

drnic avatar Jun 11 '11 01:06 drnic

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 ;)

aflatter avatar Jun 11 '11 09:06 aflatter

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

drnic avatar Jun 11 '11 13:06 drnic

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

drogus avatar Jun 11 '11 14:06 drogus