nesquena/rabl — Issue #161: Returning child nodes where there is a HABTM association
Author: aknicol
Created: 2012-02-08 10:51:58+00:00
State: open

I am having some difficulty understanding how to return results of a HABTM association. I have a model called Sale and a model called Merchandise. A HABTM association is specified for each. My .rabl file looks like the following.

object @sales

attributes :name, :date_start, :date_end

child :merchandises do
attributes :name
end

My model is simply passing @sales = Sale.all.

Nothing at all is returned in the child, even though many rows have valid relationships. Is there something else I need to do?