# Acts\_as\_tree error

**URL:** <https://www.ruby-forum.com/t/acts-as-tree-error/175878>\
**Category:** Rails\
**Created:** [September 22, 2009, 1:38am UTC](https://www.ruby-forum.com/t/acts-as-tree-error/175878 "2009-09-22T01:38:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [September 22, 2009, 1:38am UTC](https://www.ruby-forum.com/t/acts-as-tree-error/175878/1 "2009-09-22T01:38:56Z")

</div>

I am getting the following error when I attempt to use acts\_as\_tree. I  
am new to this relationship and am stuck.

undefined method `acts\_as\_tree’

Model  
class Rental \< ActiveRecord::Base  
acts\_as\_tree :order =\> “sort\_order”

validates\_presence\_of :name  
validates\_numericality\_of :sort\_order  
end

Schema  
create\_table “rentals”, :force =\> true do |t|  
t.string “name”  
t.integer “sort\_order”  
t.integer “parent\_id”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end

What am I missing?

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [September 22, 2009, 2:27pm UTC](https://www.ruby-forum.com/t/acts-as-tree-error/175878/2 "2009-09-22T14:27:26Z")

</div>

You have installed the acts\_as\_tree plugin, right?

script/plugin install acts\_as\_tree

(it’s on git://github.com/rails/acts\_as\_tree.git)

-Rob

On Sep 21, 2009, at 7:36 PM, Jason wrote:

> validates\_presence\_of :name  
> end
> 
> What am I missing?
> 
> >

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [September 25, 2009, 4:42am UTC](https://www.ruby-forum.com/t/acts-as-tree-error/175878/3 "2009-09-25T04:42:17Z")

</div>

script/plugin install acts\_as\_tree  
(git://github.com/rails/acts\_as\_tree.git)

I didn’t realize it was a plugin. The articles and book I was  
following led me to believe it was a native relationship.

Thanks!
