|
You wouldn't necessarily want join tables to be automatically dumped via to_xml, simply because for one project a single table join is sufficient, but other projects may need to join several tables to display a resouce. There's not one approach that would satisfy all instances, and to_xml chooses the most efficient approach by default.
For this example I used to_xml because it was simple, but in real world systems I've worked with a resource is comprised of more than just one model object. For all but the simplest resources I usually pull in several objects for the view.
|