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
self.site = ‘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 ?

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…


Gianluca T.
TreNetMediaMaster S.r.l.
The Internet Technology Company
Telefono +39(049)776196
Fax +39(049)8087806
Visit us @: http://www.trenet.it - http://www.mediamaster.it
e-mail me @: [email protected]

Le informazioni trasmesse sono destinate esclusivamente alla persona o
alla società in indirizzo e sono da intendersi confidenziali e riservate.
Ogni trasmissione, inoltro, diffusione o altro uso di queste
informazioni a persone o società differenti dal destinatario é proibita.
Se ricevete questa comunicazione per errore, contattate il mittente e
cancellate le informazioni da ogni computer.

Have you tried with edge?

http://dev.rubyonrails.org/ticket/8798

Héctor.
http://blog.fav2fav.net

Héctor Pérez Arenas ha scritto:

Have you tried with edge?

http://dev.rubyonrails.org/ticket/8798

Héctor.
http://blog.fav2fav.net

Hi Héctor,

thank you very much.

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

Have a nice day !