I am Stuck with the Mochijson, parsing my results.
I Have these models,
-module(post, [Id, Title, MediaReference, CuserId]).
-belongs_to(cuser).
in post.erl
and
-module(cuser, [Id, FirstName, LastName, Email, Pass, PicReference, CreationTime]).
-compile(export_all).
-has({post, many}).
in cuser.erl
And I am Greeting a Post like that:
post:new(id,"Test", "", boss_db:find("some Cuser id"))
The Post is created and Apparently Chicago boss Have No Issues,
But when i get This post from the controller it throws
Unhandled Error: exit:{json_encode,{bad_term,{
and
Stacktrace: [{mochijson2,json_encode,2,[{file,"src/mochijson2.erl"}
The boss just cant parse the results at this line :
{json, [{status, ?SUCCESS }, {data, SpecificPost}] }.
While the data it is trying to parse is :
[{post,"post-6","Test","",
{cuser,"cuser-12","Ebad2","Ali2","eb...@asdasd.cop",
"9f73574f27aa76ed2e1be7deea0c5d97","843785435",
"sometime"}}]
It is working if I remove the relationship between cuser and post.
I will really appreciate if you guys could help me.
Thanks.