我希望json输出顺序为id(子ID)
我可以解决这个问题吗?
这是我项目中的一些代码
show.json.rabl(我用过Rabl)
object @book
attributes :id , :name
child :questions do
attributes :id , :name
end
Run Code Online (Sandbox Code Playgroud)
books_controller.rb
def show
@book = Book.find(params[:id])
end
Run Code Online (Sandbox Code Playgroud)
抱歉我的英文,谢谢.