http://vaskas.me/blog/2012/02/07/using-hashes-as-activeresource-collections/
class RoleJsonFormatter
include ActiveResource::Formats::JsonFormat
def decode(json)
ActiveSupport::JSON.decode(json)["records"]
end
end
class Role < ActiveResource::Base
self.site = "http://api.people.com:3000"
self.format = RoleJsonFormatter.new
end
Немає коментарів:
Дописати коментар