> issue = Issue.find(:all)
> and getting this error:
> expected an attributes Hash, got ["issues", [{"id"=>91663, "project"=>{"id"=>77006,
> "name"=>"proj1"},....
Your `find` is expecting a singular element name back: 'issue' rather
than 'issues'.
Take a look at this:
http://www.rubydoc.info/gems/activeresource/4.0.0/ActiveResource/Collection
And do something like this:
** issue.rb **
require 'active_resource'
class Issue < ActiveResource::Base
self.site = '
http://demo.redmine.org/'
self.collection_parser = IssueCollection
end
** issue_collection.rb **
class IssueCollection < ActiveResource::Collection
def initialize(parsed = {})
@elements = parsed['issues']
end
end
HTH,
--
Hassan Schroeder ------------------------
hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote