Displaying 1 result from an estimated 1 matches for "bilder_list".
2006 Dec 10
0
Rails Recipes: Drag'n'Drop Sortable List with unique index?
...tion so it is capable
to sort the stuff with a unique index on the fields product_id and
position? Thank you very much, I''m still no great Ruby programmer yet...
:-)
def sort
produkt = Produkt.find(params[:id])
produkt.bilder.each do |bild|
bild.position = params[''bilder_list''].index(bild.id.to_s) + 1
bild.save
end
render :nothing => true
end
Keep care,
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby o...