Rails 3.1 include_root_in_json

前端 未结 3 1843
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 06:36

ActiveRecord::Base.include_root_in_json = true doesn\'t seem to be working in rails 3.10.rc4 and I don\'t see it in the docs.

Since the root element is

3条回答
  •  无人及你
    2020-12-03 07:10

    Try setting this directly on your Comment model.

    class Comment < ActiveRecord::Base
      self.include_root_in_json = true
    end
    

提交回复
热议问题