# REST: Did ActiveResource code broken ? Can't handle Resource.find(:all)

**URL:** <https://www.ruby-forum.com/t/rest-did-activeresource-code-broken-cant-handle-resource-find-all/119933>\
**Category:** Rails\
**Created:** [November 12, 2007, 12:30pm UTC](https://www.ruby-forum.com/t/rest-did-activeresource-code-broken-cant-handle-resource-find-all/119933 "2007-11-12T12:30:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianluca\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d78d45/32.png) [@gianluca\_t](https://www.ruby-forum.com/u/gianluca_t)\
**Post date:** [November 12, 2007, 12:30pm UTC](https://www.ruby-forum.com/t/rest-did-activeresource-code-broken-cant-handle-resource-find-all/119933/1 "2007-11-12T12:30:04Z")

</div>

Hi to all,

I just started with REST development, I created a very simple  
scaffold\_resource and a client app to test it.

All verbs works well but not list !!!

Here what I give when call Airport.find(:all)

./activeresource/lib/active\_resource/base.rb:465:in  
`instantiate_collection': undefined method `collect!’ for  
#Hash:0xb7b90ac0 (NoMethodError)  
from ./activeresource/lib/active\_resource/base.rb:442:in  
`find_every' from ./activeresource/lib/active_resource/base.rb:385:in `find’  
from client.rb:10:in `show\_airports’  
from client.rb:16

Did ActiveResource code broken ?

Here what I’ve generated with scaffold\_resource:

ruby script/generate scaffold\_resource airport name:string  
rake db:migrate

And here my (very simple) client.rb source:

require ‘activesupport/lib/active\_support’  
require ‘activeresource/lib/active\_resource’

# Define a model for the objects exposed by the site

class Airport \< ActiveResource::Base  
self.site = ‘[http://localhost:3000/](http://localhost:3000/)’  
end

def show\_airports  
airports = Airport.find(:all)  
puts “I retrieved #{airports.size} airports !”  
end

new\_airport = Airport.new(:name =\> “New airport”)  
new\_airport.save  
show\_airports

Someone can help me ?

Thanks in advance…
