you could do it like this:
format.json { render :json => { :websites => @allWebsites, :pages => @allPages, :element_types => @AllElementTypes, :element_data => @AllElementData } }
if you use jquery you will need to do something like:
data = $.parseJSON( xhr.responseText ); data.websites
etc.
EDIT:
When answering your question, you donโt have to parse the answer, this is what I usually do. There are a number of functions that do this for you right away, for example:
$.getJSON('/info', function(data) { var websites = data.websites, pages = data.pages, ... });
source share