Custome render xml

i want to make render xml for an complex object
ex
make render :xml => posters
poster = [name, post_id,created_at, …]
post = [title, body,created_at, …]
and i want the render output to be

name title body ... ... ... ...

thanks in advance
M.SH

You could have in your ../app/views/posters/
a file

  index.xml.builder

which may be automatically called when the
request needs to render XML. The file
could start like this:

xml.instruct!
xml.posters do
  @posters.each do |poster|
    xml.poster(...
    ...
    end
  end
end

Check out Google for "xml builder Ruby"
and this project from Jim Weirich.

  https://github.com/jimweirich/builder

HTH,

Peter

Thank u very much , that is what i need :slight_smile: