Oops... pesky phone! Google for "acts_as_list" to sort this for you.
On May 15, 2010 7:52 PM, "Albus Dumbledore" <[email protected]> wrote: Hi there! 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! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]<rubyonrails-talk%[email protected]> . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

