【发布时间】:2016-09-17 18:29:45
【问题描述】:
我将祖先 gem 用于类别模型,当我调用方法arrange_serializable 时,我希望有 cusmized 输出并添加相关模型中方法的输出。
而不是: { id: 1, name: "XYZ", children: { id: 11, name: "XYZ", children...} }
我需要: { id: 1, custom_method: "ABC", children: { id: 11, custom_method: "ABC", name: "XYZ", children...}}
我花了几天的时间才弄清楚,但没有任何运气。
任何提示如何实现这一点?
谢谢你,米罗
【问题讨论】: