So I have found how to generate json in a rails app in the wiki
(http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON), what I have
yet to figure out is how to make a synchronous call via json to rails so
that I can block while fetching the information from a user request.
I have used JSON on top of java in the past, and in order to make
synchronous calls I had to do the following:
add the json object to the page:
<jsp:useBean id=“JSONRPCBridge” scope="session
in the jsp, register a json object as an object that can be called
<% JSONRPCBridge.registerObject(“myTestObject”, aTestObject); %>
Register the JSON Servlet
Then call the function either async:
var result = jsonrpc.myTestObject.myFunction("hello"); alert(result);
I would like to know how I would go about getting to #5 in rails and
http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON really only
explains the actual writing out of the JSON object.