내 프로젝트에 여러 ActiveResource 모델이 있습니다. 내 ActiveResource에서 to_xml을 호출 할 때 내게 너무 이상했다. to_xml에 전달 된 옵션은 : 및 : except는 전혀 작동하지 않습니다. ActiveRecord에서 정말 잘 작동합니다. 누구?왜 ActiveResource의 to_xml이 제대로 작동하지 않습니까?
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
코드를 형식화하십시오 ... – Lichtamberg
to_xml이 (가) XML 문자열을 반환합니다. 그 결과로 무엇을하고 있습니까? – jonnii
나는 그것을 클라이언트에게 돌려 보낼 것이다. – Chamnap