Acts_as_tree and acts_as_list trouble


#1

I am having trouble with acts_as_tree and acts_as_list?

I have a table, pages = :id,:parent_id,:position,:title,:name.

In my model I have
acts_as_tree :order => “position”
acts_as_list :scope => :parent_id

When I add/remove rows, the position column updates perfect.

But when I try
@pg[@pg.position - 1].move_higher

I get:
NoMethodError in Admin#move_page_lower
You have a nil object when you didn’t expect it!
The error occured while evaluating nil.move_higher"

and with:
@pg.pages[@pg.position - 1].move_higher

I get:
undefined method `pages’ for #Page:0x3761718

How do I do a move_higher with acts_as_tree AND acts_as_list???