 <p>a good solution with ONE sql-query from <a href="http://henrik.nyh.se/2008/11/rails-jquery-sortables" rel="nofollow">http://henrik.nyh.se/2008/11/rails-jquery-sortables</a></p> <pre><code># in your model: def self.order(ids) update_all( ['ordinal = FIND_IN_SET(id, ?)', ids.join(',')], { :id =&gt; ids } ) end </code></pre>