On 16 Nov 2007, at 08:02, Matt Aimonetti wrote:

>
>> I'm not sure that's something we intend to support.  You should be
>> able to use, either :methods=>[:user_id] or a builder template to
>> achieve what you're after?
>
> From the RDoc:
> to_xml is controlled with :only, :except, :skip_instruct, :skip_types
> and :dasherize. The :only and :except options are the same as for the
> attributes method. To not have the column type included in the XML
> output, set :skip_types to true.
>
The rdoc also says:

> To include any methods on the object(s) being called use :methods
> firm.to_xml :methods => [ :calculated_earnings, :real_earnings ]
> <firm>
> # ... normal attributes as shown above ...
>   <calculated-earnings>100000000000000000</calculated-earnings>
>   <real-earnings>5</real-earnings>
> </firm>
>

There's also a :procs option.

Fred

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to