RABL を使用して xml を次のようにレンダリングすることは可能でしょうか?
<garbagebox>
<user><id>1</id></user>
<user><id>2</id></user>
<article><name>some name here</name></article>
<customer><rich>yes</rich></customer>
<article><name>some name here #2</name></article>
</garbagebox>
今のところ、rabl は 1 つの親内で同じ名前の複数のノードを禁止しているように見えます (コレクションは例外ですが、コレクションではすべてのノードに同じ名前が付けられています)。
たとえば、次のようにすると次のようになります。
object :garbagebox
child(Country.first) {attributes :id, :currency}
child(Customer.last) {attributes :id, :name}
child(Country.first) {attributes :id, :currency}
私は子供が3人ではなく2人しかいません。
そのようなxmlをレンダリングできるように、誰かがヒントを提供してもらえますか? ありがとう。