我将使用RABL来格式化Rails API的输出。我尝试了以下代码:
message.rabl:
我的问题是,我的message.rabl没有渲染我的局部文件,即comments.rabl。在rabl中呈现局部文件的正确方法是什么?谢谢。
message.rabl:
object @message
attributes :id,:description,:created_at,:created_by_user_id
child @comments do |t|
partial("user/comment", :object => @comments)
end
comments.rabl:
object @comments
attributes :comment_body
我的问题是,我的message.rabl没有渲染我的局部文件,即comments.rabl。在rabl中呈现局部文件的正确方法是什么?谢谢。