Sign In/My Account | View Cart  
advertisement

Article:
 Putting REST on Rails
Subject: How about joined tables?
Date: 2006-08-02 01:28:30
From: dkubb2
Response to: How about joined tables?

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.


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: