checkboxbindingvoltrb

Voltrb: Unable to save attribute through checkbox


I'm trying out a tutorial for Volt, a ruby web framework, which I had some issue.

When I try to bind the checkbox with a todo model,

<td><input type="checkbox" checked="{{ todo._completed }}" /></td>

and when I clicked it, I got the following message

[ERROR] task StoreTasks#save in 6.497ms
with args: "todos", ["todos", "[]"], {"label"=>"test", "id"=>"c2519619750f7a73a2438a2f", "completed"=>true}

{:error=>"E11000 duplicate key error collection: todo_app_development.todos index: _id_ dup key: { : \"c2519619750f7a73a2438a2f\" } (11000)"}

I've followed the tutorial [http://docs.voltframework.com/en/tutorial/todo_functionality.html ]

I've uploaded my src here. https://github.com/maclarensg/todo_app.git

Any advise is much appreciated. Thanks.


Solution

  • In my experience, duplicate key errors are a result of using MongoDB 3.2. You have to downgrade Mongo to 3.0.