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):
<h1>Add a new Topic</h1>
<% form_for :topic, @topic, :url => { :action => "create" } do |f| %> Title: <%= f.text_field :title %>
<% fields_for :posts do |post| %> Body:<%= post.text_field :body %><br/> <% 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?