I am still new to ruby/rails and there is a problem that looks rather
trivial yet I am wondering what the neatest solution may be.
I'd like the rows to be ordered "by hand", i.e. I'd like to allow the
user to indicate the ordering of the rows (e.g. this goes after that,
this goes first and so forth). As it happens, I am not a very
experienced web developer and the only solution that comes to my mind is
to use an integer column (e.g. named `position`) and when listing the
rows to order by that column. However, there is the problem that this
realization would require table locking: for instance if the user moves
the 7th item to the beginning, the `position` indexes of all the first
six rows would have to be modified (incremented by one to be precise).
I'd be very grateful I anyone could propose some nice and very
"rails-like" solution to my (I'd say rather) ordinary problem.
Thank you very much!