Code snippets used in a Ruby On Rails project to allow the user to reorder a list (in this case rows of a table) using buttons or links. On user click an asynchronous JavaScript call will be fired to inform the database, and on view the elements position is switched. Use 'shift' key to put the element/item on top or bottom of the list/table.
The RoR project use [acts_as_list]{https://github.com/swanandp/acts_as_list} gem and jQuery.