Gianluca Tessarolo
2007-Nov-12 16:44 UTC
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 Tessarolo 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 @: tessarolo.gianluca-6ZZdBs7hMehZp5Udy/Obhg@public.gmane.org ---------------------------------------------------------------------- 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Héctor Pérez Arenas
2007-Nov-12 17:49 UTC
Re: HELP ME PLEASE: Can''t get REST resource list !!!
Have you tried with edge? http://dev.rubyonrails.org/ticket/8798 -- Héctor. http://blog.fav2fav.net -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Gianluca Tessarolo
2007-Nov-13 07:33 UTC
Re: Re: HELP ME PLEASE: Can''t get REST resource list !!! [SOLVED]
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 ! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---