I have several ActiveResource model in my project. There was so
strange to me when I called to_xml on my ActiveResource. The options
that I passed to to_xml like :only and :except doesn't work at all. On
ActiveRecord, it works really well. Anyone knows?

class Node < ActiveResource::Base
   self.site = NODE_SERVER
end

# node has uuid, name, type attributes
node = Node.find("3333")
node.to_xml(:only => [:uuid])

# after here, i still get all attributes
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<node>\n  <uuid type=
\"integer\">0</uuid>\n  <name>AAAA</name>\n  <type></type>\n</node>
--~--~---------~--~----~------------~-------~--~----~
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