Acts_as_list/acts_as_tree - spostare i nodi

Ciao,
sto modificando uno scaffold per spostare i nodi.
Quindi nella vista ho messo una select name=“move” con

sposta verso sopra sposta verso sotto

Nel controller ho la funzione update dello scaffold(leggermente
modificata):
la tabella categories ha ovviamente i campi ‘position’ e ‘parent_id’.

def update
@category = Category.find(params[:id])
if params[:move]==1
@category.move_to_top
elsif params[:move]==1
@category.move_to_bottom
end
@category.reload
respond_to do |format|
if @category.update_attributes(params[:category])
flash[:notice] = ‘Category was successfully updated.’
format.html { redirect_to(@category) }
format.xml { head :ok }
else
format.html { render :action => “edit” }
format.xml { render :xml => @category.errors, :status =>
:unprocessable_entity }
end
end
end

Ma quando effettuo l’update il campo ‘position’ non cambia e il nodo
rimane fermo, dove sbaglio?

Saluti

Alberto

EDIT:
ho copiato qui sul forum male queste 2 righette:
VERSIONE GIUSTA
if params[:move]==1
@category.move_to_top
elsif params[:move]==0
@category.move_to_bottom
end
VERSIONE SBAGLIATA
if params[:move]==1
@category.move_to_top
elsif params[:move]==1
@category.move_to_bottom
end