The date field when save to mongodb is in the format of:
{ "_id" : ObjectId("4f03283e1d4ee82215000002"), "name" : "nano3", "category_id" : ObjectId("4f022b411d4ee8105700001c"), "price" : 20, "production_date(3i)" : "1", "production_date(2i)" : "1", "production_date(1i)" : "2011", "description" : "a music player with video play function" }
when I try to get the date using @product.production_date from my model it failed. I am using Mongoid mapper
date_selecthelper. If that's the case and you don't mind changing the way you store date in DB you'd better createDateobject from params that come in request and then store it into DB. In that case there'll be no problems with storing and retrieving it back from DB. If you share more code you can get more help regarding these changes. - KL-7