I am trying to fetch data from rest api through browser query ""http://abc.com:5555/v1/notifier/base/foo/2013-06-09T20:30Z"" works fine and returns a JSON blob.
in my models/test.class i have
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
when i call the class it returns ""ActiveResource::ResourceNotFound: Failed. Response code = 404. Response message = Not Found. "" Help please