rails:3521
From: OZAWA Sakuro <sakuro@2...>
Date: Tue, 7 Dec 2010 14:50:54 +0900
Subject: [rails:3521] Re: Rails3 の ActiveResource で「 undefined method `collect!'for #<Hash: 」エラーが消せない
さくです。
instantiate_collection を書換えれば出来る、と思いましたが、それよりも
active_resource/formats/*.rb の decode をオーバーライドしたクラスをフォーマットに
設定してするのが正しいのかな。
こんな雰囲気のコード(未テスト)で
class SpecialXmlFormat < ActiveResource::Formats::XmlFormat
def decode(xml)
result = super
case result
when Hash...
when Array...
end
end
end
class SpecialResource
self.format = SpecialXmlFormat
end
2010/12/7 <roppongitoppogi@y...>:
> さく様。早速の返信、ありがとうございます
>
> 外部リソースは、Railsで提供されたものではありません。詳
> しい仕様は、お見せすることができない状況です。。
--
OZAWA Sakuro
"I think we can agree, the past is over." - George W. Bush
--
ML: rails@r...
使い方: http://QuickML.com/
3517 2010-12-07 04:35 [roppongitoppogi@y...] Rails3 の ActiveResource で「 undefined method `collect!' for #<Hash:」エラーが消せない 3518 2010-12-07 05:44 ┗[sakuro@2... ] 3519 2010-12-07 06:00 ┗[roppongitoppogi@y...] -> 3521 2010-12-07 06:50 ┗[sakuro@2... ]