# Undefined method 'act\_as\_tree'

**URL:** <https://www.ruby-forum.com/t/undefined-method-act-as-tree/121185>\
**Category:** Rails\
**Created:** [November 25, 2007, 12:42am UTC](https://www.ruby-forum.com/t/undefined-method-act-as-tree/121185 "2007-11-25T00:42:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 25, 2007, 12:42am UTC](https://www.ruby-forum.com/t/undefined-method-act-as-tree/121185/1 "2007-11-25T00:42:35Z")

</div>

I have 2 models: topic model and post:

class Topic \< ActiveRecord::Base  
has\_many :posts  
end

class Post \< ActiveRecord::Base  
acts\_as\_tree :order=\>“body”  
belongs\_to :topic  
end

and I have a view for creating new topic (and new post):

# Add a new Topic

\<% form\_for :topic, @topic, :url =\> { :action =\> “create” } do |f| %\>  
Title: \<%= f.text\_field :title %\>

\<% fields\_for :posts do |post| %\>  
Body:\<%= post.text\_field :body %\>  
  
\<% end %\>

\<%= submit\_tag ‘Post Topic’, :class =\> “submit” %\>  
\<% end %\>

I get the undefined method ‘act\_as\_tree’ error in the  
TopicsController: (in the create method)  
@post = Post.new(params[:post])

any ideas?

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 25, 2007, 1:04am UTC](https://www.ruby-forum.com/t/undefined-method-act-as-tree/121185/2 "2007-11-25T01:04:52Z")

</div>

On 24 Nov 2007, at 23:41, oren wrote:

> class Post \< ActiveRecord::Base  
> acts\_as\_tree :order=\>“body”  
> belongs\_to :topic  
> end
> 
> I get the undefined method ‘act\_as\_tree’ error in the

What version of rails are you running? In 2.0 acts\_as\_tree (along with  
a bunch of stuff) has been moved into separate plugins.

Fred

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 25, 2007, 4:47am UTC](https://www.ruby-forum.com/t/undefined-method-act-as-tree/121185/3 "2007-11-25T04:47:02Z")

</div>

edge…  
I guess I need to google for this plug-in.

thanks!

On Nov 24, 4:04 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
