One of my active record subclasses has a method that creates a json-like representation. Is this the way to answer an array of that data?
# answer is an array
answer = MyModel.fetch()
respond_to do |format|
format.json { render :json => answer.collect { |e| e.as_special_json } }
end
I don't think this is right. I guess I don't really understand what render :json is all about. I think this will json encode the almost-json. Is there any way to just answer the almost-json like any other json?