XML output generates dashes rather than underscore

Hey all,

I'm trying to change the xml output from a dash to underscore:

<updated-at type="datetime">2010-01-15T17:00:23Z</updated-at>

to

<updated_at type="datetime">2010-01-15T17:00:23Z</updated_at>

Does anyone have any suggestions? Thanks.

Hi John,

John Merlino wrote:

Hey all,

I'm trying to change the xml output from a dash to underscore:

<updated-at type="datetime">2010-01-15T17:00:23Z</updated-at>

to

<updated_at type="datetime">2010-01-15T17:00:23Z</updated_at>

Does anyone have any suggestions? Thanks.

An excerpt from the Rails docs on to_xml:
http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M001926&name=to_xml

Just in case, if you're using the to_xml method, add :dasherize => false
to the options.

HTH,
Bill