I am using the popular Rabl gem for producing a JSON API in Rails. However, 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?