Why to_xml on ActiveResource does not work well?

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\n <uuid type=

“integer”>0\n AAAA\n \n

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs