Removing child root nodes in RABL

后端 未结 4 1795
情歌与酒
情歌与酒 2020-12-29 22:52

I\'m trying to render a pretty simple data structure using RABL, but I can\'t figure out how to remove the child root nodes properly. Here are my two templates.

Fir

4条回答
  •  渐次进展
    2020-12-29 23:34

    Try replacing:

        child :files do
          extends 'groups/_file'
        end
    

    with:

        node :files do |group|
          group.files.map do |file|
            partial 'groups/_file', object: file, root: false
          end
        end
    

提交回复
热议问题