A small tip for render json

132 views
Skip to first unread message

Angelo

unread,
Apr 22, 2011, 12:33:53 PM4/22/11
to rhomobile
Hi,
I'm using Rhodes Framework with Sencha, who use a lot of json
requests.
If you want render a correct json response so you don't use
JSON.parse(), you can set the response header
you can use:
def show
@response['headers']['Content-Type']='application/json;
charset=utf-8'
render :string => my_json_response
end
In this way Rhodes and Sencha are Happy to work togheter
Regards
Angelo

evgeny vovchenko

unread,
Apr 22, 2011, 1:10:29 PM4/22/11
to rhom...@googlegroups.com
Just a note: to parse json faster you can use
Rho::JSON.parse
which is native json parser implementation.

--
You received this message because you are subscribed to the Google Groups
"rhomobile" group.
To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to
rhomobile+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rhomobile?hl=en.

Reply all
Reply to author
Forward
0 new messages