Forum: Ruby on Rails ActiveResource

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Efea8c8cec85985403bae64bef84e7a3?d=identicon&s=25 Matt Beedle (mattb)
on 2007-04-12 16:17
Can someone give me a quick rundown on ActiveResource?  Is is included
in rails 1.2.3?  How do I start using it?  How does it work with
ActiveRecord?  Is there a script/generate command for it?  Where is the
documentation and tutorials?

Thanks in advance.
6edd67c92a1dab5eb23fed79f3c18564?d=identicon&s=25 DHH (Guest)
on 2007-04-12 16:20
(Received via mailing list)
> Can someone give me a quick rundown on ActiveResource?  Is is included
> in rails 1.2.3?  How do I start using it?  How does it work with
> ActiveRecord?  Is there a script/generate command for it?  Where is the
> documentation and tutorials?

Active Resource has yet to get an official release. It's not included
in 1.2.3, only available from SVN.

Ryan has an intro at:
http://ryandaigle.com/articles/2006/06/30/whats-ne...
Guide to get it working in your app:
http://reprocessed.org/blog/archives/2006/08/01/ac...
8310c5a7c769345114597bcdef111488?d=identicon&s=25 Ben Munat (Guest)
on 2007-04-12 19:58
(Received via mailing list)
Is there a version being targeted for adding it to rails?

b
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-04-12 20:44
(Received via mailing list)
I submitted a patch to do just this but was told that ARes will probably
be
an external install from Rails. For now, as says the guide DHH posted,
you'll need to manually type out the path to the activeresource install.
Otherwise, the library works quite well and I've yet to find any issues
with
it.

Simply define your models to be:

class MyResource < ActiveResource::Base
  self.site_url = "http://path/to/server"
   ... credentials ...
end

and you're on your way. You only get #find for now, depending on how
much
data the server is sending back (the :include directive of to_xml).

Just a warning though, I did have a problem with the server code and
#to_xml, described here: http://dev.rubyonrails.org/ticket/8017

Jason
This topic is locked and can not be replied to.