Removing child root nodes in RABL

后端 未结 4 1782
情歌与酒
情歌与酒 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:22

    This is the usual way of removing the root json (rather than specifying object_root: false)

    config/initializers/rabl_config.rb

    Rabl.configure do |config|
      config.include_json_root = false
    end
    

    Does moving that to there (and restarting rails), fix it?

提交回复
热议问题