开发者

Rails to_xml override

开发者 https://www.devze.com 2022-12-24 07:45 出处:网络
If y开发者_运维知识库ou have an array in Rails, to_xml will nest each object under a \'records\' tag. Is there a way to override this to name it something else?my_array.to_xml :root => \'foos\'

If y开发者_运维知识库ou have an array in Rails, to_xml will nest each object under a 'records' tag. Is there a way to override this to name it something else?


my_array.to_xml :root => 'foos'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号