Problems with acts_as_tree---urgent need help

Hi,

Does anyone know if there is any tutorials about act_as_tree ? Or can anyone provide step-by-step method of using acts_as_tree?

Have tried looking for answers but kept getting "NoMethodError: undefined method `acts_as_tree'".

Thanks

Ryan Bigg wrote:

Did you install it properly? acts_as_tree has been taken out of rails core and moved to a plugin, so you might not have it installed.

Thanks -- Posted via http://www.ruby-forum.com/.

>

-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email.

Hi,

How do I check if it is installed properly? If its not installed properly how or what are the steps to do so?

Thanks

to MSN and/or GTalk as this email.

Hi,

How do I check if it is installed properly? If its not installed properly how or what are the steps to do so?

Well if you have a folder called acts_as_plugin in vendor/rails it's
probably ok, if it isn't then it's definitely not (you can get it from http://svn.rubyonrails.org/rails/plugins/acts_as_tree/)

Fred

Frederick Cheung wrote:

I don't have a directory vendor/rails at all. I do have vendor/ plugin. This project is an upgrade from 1.2.6 to 2.0.2. Note however that when I create a new project, e.g. "rails newproject", the newproject/vendor directory there does not have a rails directory either.

Without a vendor/rails directory, I too get the "undefined method: acts_as_tree' error. If I create such a directory, I can't even start the web server.

I have removed and then reinstalled the acts_as_tree plugin, using the ./script/plugin install acts_as_tree syntax.

What am I missing?

steven

Figured it out. I had to add the plugin name 'acts_as_tree' to config.plugins in my config/environment.rb file.

I could be mistaken, but I believe that acts_as_tree will be located in vendor/plugins (not vendor/rails) when installed properly. Creating an empty vendor/rails directly will definitely cause you problems because your app will look for rails there instead of the standard system location. When it doesn't find it, it won't start.

Anyway, on my machine with rails 2.0.2, the usual 'ruby script/plugin install acts_as_tree' put it into the vendor/rails directory.

-Kyle