Can anyone help me how to decode JSON object from Rails. Basically I have javascript function that encode JSON object and pass it to rails.
function save(){
----
----
notesArray.push({ Index: i, Title: title.val(), Content: content.val()});
// json encode it
var jsonStr = JSON.stringify(notesArray);
//sending to rails
$.post('monkey', {notes: jsonStr});
}
I don't know how to decode this in my controllers in Rails. I also want it to save it in my database(SQLite). Any idea how to do this?