gem activerecord-sortable allows you easily integrate jquery ui sortable with your models