title: Backbone Mongoid Rails set up will not let me update a record
body: <p>Can someone help me understand how to make <a href="http://railscasts.com/episodes/323-backbone-on-rails-part-1?view=comments" rel="nofollow">Ryan Bate's screencast</a> on Backbone.js work with MongoDB as my database while using the Mongoid gem. </p>
  
  <p>This is what I am seeing.</p>
  
  <p>When I create a new entry via the console, similar to how Ryan did it in the video with <code>entry.create</code>, Rails adds that entry just fine. Below is my Ruby log and my JavaScript headers log from Chrome Inspector.</p>
  
  <h2>Ruby Log</h2>
  
  <pre><code>Started POST "/api/entries" for 127.0.0.1 at 2012-02-12 17:31:24 -0600
  Processing by EntriesController#create as JSON
  Parameters: {"name"=&gt;"Heather", "entry"=&gt;{"name"=&gt;"Heather", "action"=&gt;"create",         "controller"=&gt;"entries"}}
  MONGODB w_market_development['system.namespaces'].find({})
  MONGODB           w_market_development['entries'].insert([{"_id"=&gt;BSON::ObjectId('4f384bcc504b9348be000003'),     "name"=&gt;"Heather"}])
  Completed 201 Created in 11ms (Views: 2.4ms)
  </code></pre>
  
  <h2>Headers Log</h2>
  
  <pre><code>Request URL:http://0.0.0.0:3000/api/entries
  Request Method:POST
  Status Code:201 Created
  Request Headers (14)
  Request Payload
  {"name":"Heather"}
  </code></pre>
  
  <p>As you can see it posted fine. Now let me show you an update via the <code>entry.save()</code> example Ryan showed us.</p>
  
  <h2>Ruby Log</h2>
  
  <pre><code>Started POST "/api/entries" for 127.0.0.1 at 2012-02-12 17:34:25 -0600
  Processing by EntriesController#create as JSON
  Parameters: {"_id"=&gt;"4f38152c504b9345dc000005", "name"=&gt;"Bloip", "winner"=&gt;true,     "entry"=&gt;{"_id"=&gt;"4f38152c504b9345dc000005", "name"=&gt;"Bloip", "winner"=&gt;true,     "action"=&gt;"create", "controller"=&gt;"entries"}}
  MONGODB w_market_development['system.namespaces'].find({})
  MONGODB     w_market_development['entries'].insert([{"_id"=&gt;BSON::ObjectId('4f38152c504b9345dc000005'),     "name"=&gt;"Bloip", "winner"=&gt;true}])
  Completed 201 Created in 12ms (Views: 2.7ms)
  </code></pre>
  
  <h2>Headers Log</h2>
  
  <pre><code>Request URL:http://0.0.0.0:3000/api/entries
  Request Method:POST
  Status Code:201 Created
  Request Headers (14)
  Request Payload
  {"_id":"4f38152c504b9345dc000005","name":"Bloip","winner":true}
  </code></pre>
  
  <hr>
  
  <p>As you can see when I complete the <code>entry.save()</code> on a current entry, which should be an update, the JSON is showing a POST instead of a PUT, which Mongoid is doing nothing with and the DB shows no changes. After Googling I found the following articles but nothing really helped.</p>
  
  <p><a href="https://github.com/codebrew/backbone-rails/issues/8" rel="nofollow">https://github.com/codebrew/backbone-rails/issues/8</a>
  http://lostechies.com/derickbailey/2011/06/17/making-mongoid-play-nice-with-backbone-js/</p>