Suppose I have a controller method like so…
def index
@burried_treasures = BurriedTreasure.all
render :xml => @burried_treasure
end
Right now it places all values in tags such as:
<burried_treasure>
<name>Red Beard</name>
</burried_treasure>
I would like it to use attributes like this:
<burried_treasure name="Red Beard">
Does anyone know how to accomplish this?
You will have to override your models to_xml method
See more info on Builder::XmlMarkup usage at http://ap.rubyonrails.org/classes/Builder/XmlMarkup.html