This project is archived and is in readonly mode.

#1345 ✓wontfix
Ernesto Jiménez

Array#to_xml accepts :root_attrs

Reported by Ernesto Jiménez | November 7th, 2008 @ 06:50 PM | in 2.x

You can define root attributes using :root_attrs option:

@projects.to_xml(:root_attrs => {:page => 1, :per_page => 3})

<?xml version="1.0" encoding="UTF-8"?>
<projects page="1" per_page="3" type="array">
    <name>project 1</name>
    <name>project 2</name>
    <name>project 3</name>

This is useful for paginated XMLs

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>