我正在尝试通过浏览器查询“” http://abc.com:5555/v1/notifier/base/foo/2013-06-09T20:30Z “”从rest api获取数据工作正常并返回一个JSON blob。
在我的模型/test.class 我有
class foo::base < ActiveResource::Base
class << self
def element_path(id, prefix_options = {}, query_options = nil)
prefix_options, query_options = split_options(prefix_options) if query_options.nil?
"#{prefix(prefix_options)}#{collection_name}/#{id}#{query_string(query_options)}"
end
def collection_path(prefix_options = {}, query_options = nil)
prefix_options, query_options = split_options(prefix_options) if query_options.nil?
"#{prefix(prefix_options)}#{collection_name}#{query_string(query_options)}"
end
end
ActiveResource::Base.site = 'http://abc.com:5555/'
self.format = :json
self.collection_name='v1/notifier/base'
def self.search
results = []
results << self.find(:one, :from => '/foo/2013-06-09T20:30Z')
puts results
end
当我调用该类时,它返回“”ActiveResource::ResourceNotFound:失败。响应代码 = 404。响应消息 = 未找到。““ 请帮忙