I have a ruby on rails application that has two models - sheets and sub_tests. Ltest has an association ' has_many' with sub_tests. The show method for ltests has the following.
respond_to do |format|
format.html
format.xml { render :xml => @ltest }
end
This creates an ltest object. However, sub_tests owned by ltest are not displayed.
How can i do this?
<ltest>
....
<sub_test>
...
</sub_test>
<sub_test>
...
</sub_test>
</ltest>
I tried to do this with the following look:
But this generates two XML documents, not one with sub_tests built into the libraries.
Any suggestions on how I can do this?
Manoj
source
share