combining associated models into a single xml or json object

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

No sooner do I post than I realize my mistake.

(:include is the message to .to_json, not 'find')

i.e.

f.json { render :json => folder.to_json(:include=> [permissions]) }

Thanks,
j