Hunter Peress
2007-Aug-27 06:04 UTC
[Betternestedset-talk] undefined method `self_and_ancestors''
better_nested_set is inside vendors. Why am i getting: undefined method `self_and_ancestors'' for #<Array:0xb6a98830> from @menuselect = Menu.find(:all) selectpath = @menuselect.self_and_ancestors -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/betternestedset-talk/attachments/20070827/315eb8d1/attachment.html
Brian Sheehan
2007-Aug-27 09:49 UTC
[Betternestedset-talk] undefined method `self_and_ancestors''
Have you called acts_as_nested_set in your class definition? You should have something like this: class Menu < ActiveRecord::Base acts_as_nested_set ... rest of class definition ... end Brian On 8/27/07, Hunter Peress <hunterp at gmail.com> wrote:> better_nested_set is inside vendors. Why am i getting: > > undefined method `self_and_ancestors'' for #<Array:0xb6a98830> > > from > @menuselect = Menu.find(:all) > selectpath = @menuselect.self_and_ancestors > > > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk > >
Krishna Dole
2007-Aug-27 13:40 UTC
[Betternestedset-talk] undefined method `self_and_ancestors''
Menu.find(:all) returns an array of Menu objects. Calling self_and_ancestors on an individual menu object should work fine. Krishna On 8/27/07, Hunter Peress <hunterp at gmail.com> wrote:> better_nested_set is inside vendors. Why am i getting: > > undefined method `self_and_ancestors'' for #<Array:0xb6a98830> > > from > @menuselect = Menu.find(:all) > selectpath = @menuselect.self_and_ancestors > > > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk > >