# ActiveResource

**URL:** <https://www.ruby-forum.com/t/activeresource/91816>\
**Category:** Rails\
**Created:** [April 12, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/activeresource/91816 "2007-04-12T16:17:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![burrowsm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Post date:** [April 12, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/activeresource/91816/1 "2007-04-12T16:17:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![burrowsm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Post date:** [April 12, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/activeresource/91816/2 "2007-04-12T16:20:26Z")

</div>

> 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-new-in-edge-rails-activeresource-is-here](http://ryandaigle.com/articles/2006/06/30/whats-new-in-edge-rails-activeresource-is-here)  
Guide to get it working in your app:  
[http://reprocessed.org/blog/archives/2006/08/01/active\_resource\_on\_edge.html](http://reprocessed.org/blog/archives/2006/08/01/active_resource_on_edge.html)

---

<div class="post-metadata">

**Author:** ![burrowsm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Post date:** [April 12, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/activeresource/91816/3 "2007-04-12T19:58:52Z")

</div>

Is there a version being targeted for adding it to rails?

b

---

<div class="post-metadata">

**Author:** ![burrowsm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Post date:** [April 12, 2007, 8:44pm UTC](https://www.ruby-forum.com/t/activeresource/91816/4 "2007-04-12T20:44:57Z")

</div>

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](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](http://dev.rubyonrails.org/ticket/8017)

Jason
