I'm using
def index
@services = Service.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @services }
end
end
to render an XML with all the services.
What is the right syntax to add another a开发者_运维技巧rray to the xml?
I mean to add for example
@activities = Activity.all
Thanks!
You can use
format.xml {render :xml => {:services => @services, :activities => @activities}}
精彩评论