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
---------------------------
This behavior can be controlled with :only, :except, :skip_instruct, 
:skip_types, :dasherize and :camelize . The :only and :except options 
are the same as for the attributes method. The default is to dasherize 
all column names, but you can disable this setting :dasherize to false. 
Setting :camelize to true will camelize all column names - this also 
overrides :dasherize. To not have the column type included in the XML 
output set :skip_types to true.
---------------------------

@model.to_xml :dasherize => false
-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to