Tag Archives: rest

Using rails and respond_to to include nested data

I want to display data from a nested table in my XML output using respond_to. I browsed the docs a bit and it seems :include is the way to go. However I had some problems getting this to work properly.

I have two models (customer and user) that are linked together. When I fetch the data for a single user, I want my xml output to include the customer data.

Tagged , , , | Comments Off