# To\_xml node names with underscores

**URL:** <https://www.ruby-forum.com/t/to-xml-node-names-with-underscores/115905>\
**Category:** Rails\
**Created:** [September 30, 2007, 5:00am UTC](https://www.ruby-forum.com/t/to-xml-node-names-with-underscores/115905 "2007-09-30T05:00:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [September 30, 2007, 5:00am UTC](https://www.ruby-forum.com/t/to-xml-node-names-with-underscores/115905/1 "2007-09-30T05:00:13Z")

</div>

When I call to\_xml on my active record objects, it replaces  
underscores with hypens. E.g.:

 1 2 Traffic Alerts

When the actual field is content\_provider\_id. I remember seeing an  
option for this somewhere… Any ideas?

---

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [September 30, 2007, 5:07am UTC](https://www.ruby-forum.com/t/to-xml-node-names-with-underscores/115905/2 "2007-09-30T05:07:14Z")

</div>

[http://api.rubyonrails.com/classes/ActiveRecord/XmlSerialization.html](http://api.rubyonrails.com/classes/ActiveRecord/XmlSerialization.html)

Found it. What’s the point of dasherizing anyways?
