Acts_as_tree error

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?

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
[email protected]

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!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs