2011-08-24 70 views
1

我使用zerigo_dns 1.2.0 gem(https://github.com/twilson63/zerigo_dns),它需要使用ActiveResource進行'請求'調用。它在Rails 3.0.4中工作正常,因爲默認格式是XML。但Rails 3.1.0.rc4使用JSON作爲默認值,並且導致問題,因爲Zerigo期待應用程序/ xml mime類型。Zerigo DNS gem與ActiveResource 3.1不兼容

任何人都知道如何切換到有效使用XML作爲默認格式?

回答

1

Zerigo :: DNS ::基地從繼承的ActiveResource。你應該可以做

Zerigo::DNS::Base.format = :xml 
+0

ahh ...這是一個更好的,謝謝! – mountriv99

0

得到它與這隻猴子補丁工作:

class Zerigo::DNS::Base 
def self.format 
    self._format || ActiveResource::Formats::XmlFormat 
end 
end