HELP ME PLEASE: Can't get REST resource list !!!

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

Here what I've generated with scaffold_resource under Rails 1.2.5:

ruby script/generate scaffold_resource airport name:string rake db:migrate

And here my (very simple) client.rb source using activeresource from trunk:

require 'activesupport/lib/active_support' require 'activeresource/lib/active_resource'

class Airport < ActiveResource::Base = 'http://localhost:3000/’ end

def show_airports   airports = Airport.find(:all)   puts "I retrieved #{airports.size} airports !" end

new_airport = => "New airport") show_airports

Someone can help me ?

My goal is to write a system with some decoupled rails app using RESTful web services, is it possible at this time or may I wait for Rails 2.0 ?

Thanks in advance...

Héctor Pérez Arenas ha scritto:

Have you tried with edge?



Hi Héctor,

thank you very much.

The edge seems broken too but the patch works well !!!

Have a nice day !