Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


ActiveResource find() not following JSON api #75

hoetmaaiers opened this Issue · 3 comments

4 participants


When following the JSON API document, I return my singular resources in an array as described:

   "designs": [
      // individual design

My app talking to the API uses ActiveResource. When I do a find in ActiveRescource


I get the following error:

ArgumentError: expected an attributes Hash, got [{"id"=>10, "title"=>" ...

ActiveResource seems to have trouble with return singular resources as an array.
Any thoughts or help on this?


Active Resource expects an attributes hash back. If you're working with an API that doesn't conform to Active Resource exactly, I would strongly recommend looking into using something different, such as HTTParty, to provide the code that talks with your API.


or you can use custom formatter


See the comments in the collections class about using a collections parser. This worked for me in exactly the situation you described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.