It is clear how to return a model with model.to_json or model.to_xml.
But how does one returned an object that with associations included?
I thought the following would work but it seems to only return the
base model.
folder = Folder.find_by_id(7, :include => [permissions])
respond_to do |f|
…
f.json { render :json => folder.to_json}
end
Thanks,
j